public static function wrap($qls){ $qlList = array(); foreach( $qls as $ql ){ array_push($qlList, new Quick_Login($ql['quick_loginid'], $ql['hash'], $ql['userid'], $ql['expires'], $ql['used'])); } return Quick_Login::sendback($qlList); }
$data['fname'] = isset($_POST['fname']) ? $_POST['fname'] : null; $data['lname'] = isset($_POST['lname']) ? $_POST['lname'] : null; if( ($password == $vp) && ($data['email'] == $data['vemail']) && ($password != null) && ($data['email'] != null) ){ if( Authentication::checkIdentity($data['email']) == 0 ){ //create user $user = User::add($data['fname'],$data['lname'],$data['email'],$password,3); if( $user ){ $auth = $user->authentication; $auth->resetPassword = 0; $auth->disabled = 1; $auth->save(); //create login hash $hash = hash('whirlpool', $user->authentication->identity . time() . (time() / 64)); if( !Quick_Login::add($hash, $user->userid, time() + 3600, 0) ){ // die } //load email template ob_start(); include('templates/account_create.html'); $body = ob_get_clean(); if( Mail::sendMail($user->contact->email, '*****@*****.**', "Afterthought System Database Email Verification", $body) ){ //redirect to login throw new RedirectBrowserException("/index.php?code=6"); } } else{ throw new RedirectBrowserException("/index.php?a=request&code=8&" . http_build_query($data));
'.', 'backbone', 'components', 'content', 'model', 'render', 'scripts', 'styles', 'images' ); $includePath = implode( PATH_SEPARATOR . $home, $paths ); set_include_path( get_include_path() . PATH_SEPARATOR . $includePath ); require_once('RedirectBrowserException.php'); require_once('User.php'); require_once('Session.php'); require_once('Quick_Login.php'); setSession(0, '/'); $code = isset($_GET['code']) ? $_GET['code'] : null; if( $code ){ $ql = Quick_Login::getByHash($code); if( $ql ){ $user = User::getByID($ql->userid); $user->disabled = 0; $user->save(); setSessionVar('active', true); setSessionVar('roleid', $user->authentication->role->roleid); setSessionVar('userid', $user->userid); $ql->used = 1; $ql->save(); throw new RedirectBrowserException("/home.php?code=0"); } else{