rpicms

A CMS for the Raspberry Pi
git clone git://archive.git.mtrnord.blog/RpicmsTeam/rpicms.git
Log | Files | Refs | README | LICENSE

activate-account.php (1129B)


      1 <?php 
      2 /*
      3 UserCake Version: 2.0.1
      4 http://usercake.com
      5 */
      6 require_once("models/config.php");
      7 if (!securePage($_SERVER['PHP_SELF'])){die();}
      8 
      9 //Get token param
     10 if(isset($_GET["token"]))
     11 {	
     12 	$token = $_GET["token"];	
     13 	if(!isset($token))
     14 	{
     15 		$errors[] = lang("FORGOTPASS_INVALID_TOKEN");
     16 	}
     17 	else if(!validateActivationToken($token)) //Check for a valid token. Must exist and active must be = 0
     18 	{
     19 		$errors[] = lang("ACCOUNT_TOKEN_NOT_FOUND");
     20 	}
     21 	else
     22 	{
     23 		//Activate the users account
     24 		if(!setUserActive($token))
     25 		{
     26 			$errors[] = lang("SQL_ERROR");
     27 		}
     28 	}
     29 }
     30 else
     31 {
     32 	$errors[] = lang("FORGOTPASS_INVALID_TOKEN");
     33 }
     34 
     35 if(count($errors) == 0) {
     36 	$successes[] = lang("ACCOUNT_ACTIVATION_COMPLETE");
     37 }
     38 
     39 require_once("models/header.php");
     40 
     41 echo "
     42 <body>
     43 <div id='wrapper'>
     44 <div id='top'><div id='logo'></div></div>
     45 <div id='content'>
     46 <h1>UserCake</h1>
     47 <h2>Activate Account</h2>
     48 
     49 <div id='left-nav'>";
     50 
     51 include("left-nav.php");
     52 
     53 echo "
     54 </div>
     55 <div id='main'>";
     56 
     57 echo resultBlock($errors,$successes);
     58 
     59 echo "
     60 </div>
     61 <div id='bottom'></div>
     62 </div>
     63 </body>
     64 </html>";
     65 
     66 ?>