define( '_JEXEC', 1 ); define('JPATH_BASE', '/home/aasr/public_html' ); define( 'DS', '/' ); require_once ("/home/aasr/public_html/includes/defines.php"); require_once ("/home/aasr/public_html/includes/framework.php"); $mainframe =& JFactory::getApplication('site'); $mainframe->initialise(); // require_once ("/home/aasr/public_html/libraries/joomla/table/table.php"); require_once ("/home/aasr/public_html/libraries/jauthtools/token.php"); /* ini_set('display_errors', 'off'); error_reporting(0); */ $dbo =& JFactory::getDBO(); $state = $_REQUEST["state"]; //$conn = mysql_connect("ec2-database01.exto.nl", "aasr", "chiu8Ti1"); if($state == "check_code") { $email = mysql_real_escape_string($_REQUEST["email"]); $code = mysql_real_escape_string($_REQUEST["code"]); $sql = "SELECT u.username, u.id FROM jos_users u, jos_contact_details c WHERE c.misc = '$code' AND c.user_id = u.id AND (u.email = '' OR u.email IS NULL OR u.email = 'x@x.x')"; $result = mysql_query($sql); if(mysql_num_rows($result) > 0) { $row = mysql_fetch_assoc($result); $username = $row["username"]; $id = $row["id"]; $sql = "UPDATE jos_users SET email = '$email' WHERE id = $id"; mysql_query($sql); $state = "login_email"; $ip = $_SERVER['REMOTE_ADDR']; file_put_contents('/tmp/kap.log', "$email to $code to $ip\n", FILE_APPEND); } else { $state = "code"; } } if($state == "login_email") { // loginnaam zoeken adhv emailadres $email = mysql_real_escape_string($_REQUEST["email"]); if($email != '') { $sql = "SELECT username FROM jos_users WHERE email = '$email'"; $result = mysql_query($sql); if(mysql_num_rows($result) > 0) { $row = mysql_fetch_assoc($result); $username = $row["username"]; $token_issuer = new JAuthToolsToken($dbo); $token = $token_issuer->issueToken($username, 24, 1000, '/'); $url = "http://www.aasr.nl/index.php?option=com_tokenlogin&logintoken=$token"; ?>
Er is een mail gestuurd naar echo $email ?> met een link om in te loggen als gebruiker echo $username ?>.