0, 'end' => 0);
var $_systemVersion = 'C1.2.6'; // Version number.
var $_systemOptions = array(
/*
* Default _systemOptions
*/
'var_name' => 'phpuserlogin', // Is then word used a the name of the var's outside php (forms, urls) that have something to do with phpuserlogin2, must be changed for every new login object
'page' => PHPUSERLOGIN_PAGE, // Is the page where users may login, default is everywhere.
'page_afterlogin' => '', // Is the url for the page the users should be sent to right after login (only after login), default is non = user is not sent to a new page.
'hidden_key' => 987412365123698745, // This is a hidden key, which is used in the cookies to make them secure, should be change every time you use the script.
'mysql_table' => 'phpuserlogin_user', // Is the name of the table where users are stored.
'mysql_serv' => 'localhost', // Is the address of the mysql server
'mysql_user' => 'root', // Is the username on the mysql server
'mysql_pass' => '', // Is the password for the mysql server
'mysql_data' => 'phpuserlogin', // Is the name of the database on the mysql server.
'mysql_pcon' => FALSE,
'mysql_fields' => FALSE, // Special option, used to manage extra tables.
'mysql_id' => 'id', // The name of the id field in the user table.
'cookie_life' => '', // How long cookies will live on the client pc, in secs.
'cookie_path' => '/', // The path on the server where the cookie will work, default is whole server.
'cookie_domain' => PHPUSERLOGIN_DOMAIN, // The domain name of the server, default is the server running the script.
'email_reply' => PHPUSERLOGIN_EMAIL, // The reply address used on mails sent by script, default is dontreply@SERVER_DOMAIN_NAME
'admins' => '', // The usernames of the admins, split each name with a ,
'lostpass' => TRUE, // Is the lost password feature on or off
'register' => FALSE, // Is the register function on or off.
'register_page' => '', // This is the page where the reg form is being printed!
// NEW - NOT IN USE
'logFile' => '' // This is the full path for the file where log entrys will be written to, default is nothing, which means that the scritp will not log anything.
);
var $_systemTextPower = 'Powered By
phpUserLogin2'; // This Text may not be removed or changed, it must be printed at the end of the login from and the register form and anywhere else it may be printed.
var $_systemText = array(
/*
* Default English
*/
'LOGIN_MISSING_USER' => 'You need to enter a username!',
'LOGIN_MISSING_PASS' => 'You need to enter a password!',
'LOGIN_TO_MANY_USERS' => 'To many users with the same username was found. - Contact the webmaster!',
'LOGIN_WRONG_USER' => 'You have entered a wrong username!',
'LOGIN_WRONG_PASS' => 'You have entered a wrong password!',
'COOKIES_FAKE' => 'The cookies are not valid!',
'COOKIES_NO_USER' => 'The user you have logged in with does not exist anymore!',
'COOKIES_TO_MANY_USERS' => 'There is more then one user with the username you logged in with. - Contact the webmaster!',
'COOKIES_LOGGED_IN' => 'You are logged in!',
'LOST_MISSING_USER' => 'You need to enter a username!',
'LOST_TO_MANY_USERS' => 'To many users with the same username was found. - Contact the webmaster!',
'LOST_WRONG_USER' => 'No user with that username was found!',
'LOST_TO_FAST' => 'This user have already requested a new password within the last day!',
'LOST_NO_REQUEST' => 'This user have not requested a new password!',
'LOST_WRONG_KEY' => 'The two keys did not match - No new password will be made!',
'EMAIL_NONE' => 'No email address was found!',
'EMAIL_NO_GO' => 'Could not send email. - Contact the webmaster!',
'ERROR_MISSING_MSG' => 'Error - No script message found!',
'MYSQL_NO_CON' => 'Could not connect to the MySQL server!',
'MYSQL_NO_CON_P' => 'Could not connect (
Persistent) to the MySQL server!',
'MYSQL_NO_DATAB' => 'Could not select the database!',
'MYSQL_QUERY_ERROR' => 'Error while running query on database!',
'REG_MISSING_USER' => 'You need to enter an username!
Go back and try again.',
'REG_MISSING_PASS' => 'You need to enter a password!
Go back and try again.',
'REG_MISSING_EMAIL' => 'You need to enter an email!
Go back and try again.',
'REG_WRONG_PASS' => 'The two passwords where not the same!
Go back and try again.',
'REG_USER_E' => 'The username you have used is already in use!
Go back and try again with another username.',
'REG_USER_MADE' => 'A user have been made.
You can now login!',
'REG_USER_MADE_ERROR' => 'A user have been made, but some of the info was lost while making the user.
Uusename, email and password was added into the database though, more data might also have been added but will not be listed here.
You can now login!',
'SPAM' => 'You have used the forms to much within to little time
Please wait 15 min.!!',
'LOGOUT_FORCE' => 'You have been logged off!',
'LOGOUT_USER' => 'You have logged off!',
'LOGIN_USER' => 'You have logged in!',
'EMAIL_SENT' => 'An email have been sent to you!',
'regForm_1' => 'Enter an username:',
'regForm_2' => 'Enter a password:',
'regForm_3' => 'Retype the password:',
'regForm_4' => 'Enter your e-mail:',
'regForm_5' => 'Confirm',
'regForm_6' => 'Please fill the form and press confirm',
'regForm_7' => 'You may not make a new user while logged in!',
'regForm_8' => 'The register function is being run on the wrong page!
Please contact the webmaster!',
'regForm_9' => 'Sorry, you may not register a new user at the moment
Please contact the webmaster for more help!',
'regForm_10' => 'Reset',
'Form_1' => 'Logout',
'Form_2' => 'Your Username:',
'Form_3' => '- Request -',
'Form_4' => 'Back to login',
'Form_5' => 'Username:',
'Form_6' => 'Password:',
'Form_7' => '- Login -',
'Form_8' => 'Lost Password',
'Form_9' => 'To login go here',
'Form_10' => 'Admin',
'After_login1' => 'If the page does not change, then click this link',
'After_login2' => 'Click here!',
'headers_sent' => 'phpUserLogin
Headers have already been sent: Stopping script.
This script must be run before any output have been sent to the browser.',
'email_footer' => 'This mail was made and sent by the php script phpUserLogin - http://www.oxyscripts.com/',
'aC_1' => 'You may not use this page.
If the page does not change within 5 secs then please click',
'aC_2' => 'here',
'loadMore_bigerror' => 'Error - To many entrys with the same id was found',
'log_on' => 'Log File On'
);
/* Connect to MySQL database and put a link in $_systemMySQL_Link */
function connectMySQL() {
if (!$this->_systemMySQL_Link) {
if ($this->_systemOptions['mysql_pcon'] == FALSE) {
if (!$link = @mysql_connect($this->_systemOptions['mysql_serv'], $this->_systemOptions['mysql_user'], $this->_systemOptions['mysql_pass'])) {
$this->_systemRespons[$this->_systemReOwner]['mysql'] = 'phpUserLogin_MySQL_NO_CON';
return FALSE;
}
} else {
if (!$link = @mysql_pconnect($this->_systemOptions['mysql_serv'], $this->_systemOptions['mysql_user'], $this->_systemOptions['mysql_pass'])) {
$this->_systemRespons[$this->_systemReOwner]['mysql'] = 'phpUserLogin_MySQL_NO_CON_P';
return FALSE;
}
}
if (!@mysql_select_db($this->_systemOptions['mysql_data'], $link)) {
$this->_systemRespons[$this->_systemReOwner]['mysql'] = 'phpUserLogin_MySQL_NO_DATAB';
return FALSE;
} else {
$this->_systemMySQL_Link = $link;
return TRUE;
}
} else {
return TRUE;
}
}
function runQuery($query) {
if ($this->connectMySQL()) {
if ($result = @mysql_query($query, $this->_systemMySQL_Link)) {
if (ereg("^INSERT", $query)) {
$id = @mysql_insert_id();
} else {
$id = -1;
}
if (ereg("^SELECT", $query)) {
$num = @mysql_num_rows($result);
} elseif (ereg("^(INSERT|UPDATE|DELETE)", $query)) {
$num = @mysql_affected_rows();
} else {
$num = -1;
}
$data = @mysql_fetch_assoc($result);
@mysql_data_seek($result, 0);
return array('num'=>$num,'data'=>$data,'result'=>$result, 'id'=>$id);
} else {
$this->_systemRespons[$this->_systemReOwner]['mysql'] = 'phpUserLogin_MySQL_QUERY_ERROR';
$this->_systemMySQL_Err[] = array('query'=>$query,'error'=>mysql_error(),'errno'=>mysql_errno());
return FALSE;
}
} else {
return FALSE;
}
}
// Loggging function
function runLog($log_entry) {
if (!empty($log_entry) && !empty($this->_systemOptions['logFile'])) {
// Opening Log File
if (@$log_fp = fopen ($this->_systemOptions['logFile'], "a+b")) {
// Writing to log file
@fwrite($log_fp, gmdate("M-d-Y H:i:s").' | '.$_SERVER['REMOTE_ADDR'].' | '.$log_entry.'
');
// Closing Log File
@fclose($log_fp);
}
}
}
function findUser($user) {
return $this->runQuery("SELECT * FROM ".$this->_systemOptions['mysql_table']." WHERE username = '".$user."'");
}
function sendMail($email, $subject, $message) {
if ($email == '' or $email == NULL) {
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_EMAIL_NONE';
return FALSE;
} else {
if (mail($email, $subject, $message."\n\n".$this->_systemText['email_footer'], 'From: '.$this->_systemOptions['email_reply']."\r\n".'Reply-To: '.$this->_systemOptions['email_reply']."\r\n")) {
return TRUE;
} else {
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_EMAIL_NO_GO';
return FALSE;
}
}
}
function checkHeaders() {
if (headers_sent() && $this->_systemHeaders == TRUE) {
echo'
'.$this->_systemText['headers_sent'].'';
exit;
}
}
function stopCaching() {
header("Expires: Sun 25 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0
}
/* Set cookies */
function startSession($_username) {
$username = $_username;
$hash = md5($_username.$this->_systemOptions['hidden_key']);
$status = 'ACTIVE';
if ($this->_systemCookiesAdv == TRUE) {
if (!empty($this->_systemOptions['cookie_life'])) {
$lifetime = (time()+$this->_systemOptions['cookie_life']);
} else {
$lifetime = NULL;
}
@setcookie ($this->_systemOptions['var_name'].'[session][user]', $username, $lifetime, $this->_systemOptions['cookie_path'], $this->_systemOptions['cookie_domain']);
@setcookie ($this->_systemOptions['var_name'].'[session][hash]', $hash, $lifetime, $this->_systemOptions['cookie_path'], $this->_systemOptions['cookie_domain']);
@setcookie ($this->_systemOptions['var_name'].'[session][status]', $status, $lifetime, $this->_systemOptions['cookie_path'], $this->_systemOptions['cookie_domain']);
} else {
@setcookie ($this->_systemOptions['var_name'].'[session][user]', $username);
@setcookie ($this->_systemOptions['var_name'].'[session][hash]', $hash);
@setcookie ($this->_systemOptions['var_name'].'[session][status]', $status);
}
}
/* Delete cookies */
function endSession() {
if ($this->_systemCookiesAdv == TRUE) {
@setcookie ($this->_systemOptions['var_name'].'[session][user]', '', 0, $this->_systemOptions['cookie_path'], $this->_systemOptions['cookie_domain'] );
@setcookie ($this->_systemOptions['var_name'].'[session][hash]', '', 0, $this->_systemOptions['cookie_path'], $this->_systemOptions['cookie_domain'] );
@setcookie ($this->_systemOptions['var_name'].'[session][status]', '', 0, $this->_systemOptions['cookie_path'], $this->_systemOptions['cookie_domain'] );
} else {
@setcookie ($this->_systemOptions['var_name'].'[session][user]');
@setcookie ($this->_systemOptions['var_name'].'[session][hash]');
@setcookie ($this->_systemOptions['var_name'].'[session][status]');
}
}
/* Spam stopper */
function spamCount($check = FALSE) {
if ($this->_systemCookiesAdv == TRUE AND $this->_systemDebug == FALSE) {
if (!isset($this->_systemOutVar['spamCounter'])) {
$this->_systemOutVar['spamCounter'] = 0;
}
if ($check == FALSE) {
$lifetime = (mktime()+900);
@setcookie ($this->_systemOptions['var_name'].'[spamCounter]', ($this->_systemOutVar['spamCounter']+1), $lifetime, $this->_systemOptions['cookie_path'], $this->_systemOptions['cookie_domain']);
} else {
if ($this->_systemOutVar['spamCounter'] < 3) {
return TRUE;
} else {
$this->_systemRespons['spam'] = TRUE;
return FALSE;
}
}
} else {
return TRUE;
}
}
function phpuserlogin($new_systemOptions = FALSE) {
/* Run time counter - Start */
$this->_systemRunTime['start'] = microtime();
/* Checking that headers have not already been sent */
$this->checkHeaders();
/* If class is called with new options, then override the old ones */
if ($new_systemOptions != FALSE && is_array($new_systemOptions)) {
foreach ($new_systemOptions as $key => $value) {
if (isset($this->_systemOptions[$key])) { // Exclude non excisting Options
$this->_systemOptions[$key] = $value;
}
}
}
@$this->_systemOutVar = array_merge ($_COOKIE[$this->_systemOptions['var_name']], $_POST[$this->_systemOptions['var_name']], $_GET[$this->_systemOptions['var_name']]);
/* If a user is already logged in */
if (@$this->_systemOutVar['session']['status'] == 'ACTIVE') {
$this->_systemReOwner = 'login';
if (@md5($this->_systemOutVar['session']['user'].$this->_systemOptions['hidden_key']) == $this->_systemOutVar['session']['hash']) {
if (@$result = $this->findUser($this->_systemOutVar['session']['user'])) {
if ($result['num'] == 1) {
// User did exist.
if ($this->_systemOutVar['logout']) {
$this->_systemRespons[$this->_systemReOwner]['action'] = 'phpUserLogin_LOGOUT_USER';
$this->endSession();
$this->runLog('"'.$result['data']['username'].'" logs off.');
} else {
$this->stopCaching();
$this->startSession($result['data']['username']);
$this->userinfo = $result['data'];
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_COOKIES_LOGGED_IN';
$this->loginstatus = TRUE;
$this->runLog('"'.$result['data']['username'].'" passes check and remains logged in.');
}
} elseif ($result['num'] > 1) {
// To many users with same username
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_COOKIES_TO_MANY_USERS';
$this->_systemRespons[$this->_systemReOwner]['action'] = 'phpUserLogin_LOGOUT_FORCE';
$this->endSession();
$this->runLog('"'.$this->_systemOutVar['session']['user'].'" is logged off by script. To many users with the same username found!');
} elseif ($result['num'] < 1) {
// No users with that username
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_COOKIES_NO_USER';
$this->_systemRespons[$this->_systemReOwner]['action'] = 'phpUserLogin_LOGOUT_FORCE';
$this->endSession();
$this->runLog('"'.$this->_systemOutVar['session']['user'].'" is logged off by script. No users with that username found!');
}
} else {
$this->_systemRespons[$this->_systemReOwner]['action'] = 'phpUserLogin_LOGOUT_FORCE';
$this->endSession();
$this->runLog('"'.$this->_systemOutVar['session']['user'].'" is logged off by script. MySQL server problems!');
}
} else {
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_COOKIES_FAKE';
$this->_systemRespons[$this->_systemReOwner]['action'] = 'phpUserLogin_LOGOUT_FORCE';
$this->endSession();
$this->runLog('"'.$this->_systemOutVar['session']['user'].'" is logged off by script. Cookies where bad!');
}
/* If a user is not logged in, run all other code */
} else {
/* Check to see how many times the user have used a form, if to many times slow him/her down for 15 mins */
if ($this->spamCount(TRUE)) {
/* User tries to login */
if (isset($this->_systemOutVar['L']['login']) && $this->URLmatch($this->_systemOptions['page'])) {
$this->_systemReOwner = 'login';
/* Deletes old cookies, if any */
$this->endSession();
if ($this->_systemOutVar['L']['username'] == '') {
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_LOGIN_MISSING_USER';
} elseif ($this->_systemOutVar['L']['password'] == '') {
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_LOGIN_MISSING_PASS';
} else {
// Anti Spam Counter
$this->spamCount();
if ($result = $this->findUser($this->_systemOutVar['L']['username'])) {
if ($result['num'] == 1) {
// User did exist.
if ($result['data']['password'] == md5($this->_systemOutVar['L']['password'])) {
$this->stopCaching();
$this->startSession($result['data']['username']);
if (!empty($this->_systemOptions['page_afterlogin'])) {
// If there has been set a page to take the user to after login, then run this.
$this->runLog('"'.$result['data']['username'].'" has logged in and being sent to another page.');
header('Refresh: 2; url='.$this->_systemOptions['page_afterlogin']);
echo'
'.$this->_systemText['LOGIN_USER'].''.$this->_systemText['After_login1'].': '.$this->_systemText['After_login2'].'';
exit;
} else {
$this->runLog('"'.$result['data']['username'].'" has logged in.');
}
$this->userinfo = $result['data'];
$this->_systemRespons[$this->_systemReOwner]['action'] = 'phpUserLogin_LOGIN_USER';
$this->loginstatus = TRUE;
} else {
// Wrong password for this username.
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_LOGIN_WRONG_PASS';
}
} elseif ($result['num'] > 1) {
// To many users with same username
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_LOGIN_TO_MANY_USERS';
} elseif ($result['num'] < 1) {
// No users with that username
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_LOGIN_WRONG_USER';
}
}
}
/* User tries to make a new user, hmm, gah */
} elseif (isset($this->_systemOutVar['REG']['register']) AND $this->URLmatch($this->_systemOptions['register_page']) AND $this->_systemOptions['register'] == TRUE) {
$this->_systemReOwner = 'register';
if ($this->_systemOutVar['REG']['username'] == '') {
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_REG_MISSING_USER';
} elseif ($this->_systemOutVar['REG']['password'] == '') {
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_REG_MISSING_PASS';
} elseif ($this->_systemOutVar['REG']['email'] == '') {
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_REG_MISSING_EMAIL';
} else {
if ($this->_systemOutVar['REG']['password'] == $this->_systemOutVar['REG']['password2']) {
// Anti Spam Counter
$this->spamCount();
if ($result = $this->findUser($this->_systemOutVar['REG']['username'])) {
if ($result['num'] < 1) {
if ($result = $this->runQuery("INSERT INTO ".$this->_systemOptions['mysql_table']." (`username`,`password`,`email`) VALUES ('".$this->_systemOutVar['REG']['username']."','".md5($this->_systemOutVar['REG']['password'])."','".$this->_systemOutVar['REG']['email']."')")) {
if (is_array($this->_systemOptions['mysql_fields'])) {
for($i = 0; $i <= count($this->_systemOptions['mysql_fields']); $i++) {
if(isset($this->_systemOptions['mysql_fields'][$i])) {
$query = "INSERT INTO ".$this->_systemOptions['mysql_fields'][$i]['table_name'];
$query_f = "(`".$this->_systemOptions['mysql_fields'][$i]['id_field']."`,";
$query_v = "VALUES ('".$result[$this->_systemOptions['mysql_id']]."',";
for($b = 0; $b <= count($this->_systemOptions['mysql_fields'][$i]['fields']); $b++) {
if (isset($this->_systemOptions['mysql_fields'][$i]['fields'][$b])) {
$input = explode('||', $this->_systemOptions['mysql_fields'][$i]['fields'][$b]);
$query_f .= "`".$input[0]."`";
$query_v .= "'".$this->_systemOutVar['REG']['ADV'][$i][$input[0]]."'";
if ($b < count($this->_systemOptions['mysql_fields'][$i]['fields'])) {
$query_f .= ",";
$query_v .= ",";
}
}
}
$query_f .= ")";
$query_v .= ")";
$querys[] = $query." ".$query_f." ".$query_v;
}
}
$num_q = count($querys);
$num_failed = 0;
for($i = 0; $i < $num_q; $i++) {
if (!$this->runQuery($querys[$i])) {
$num_failed++;
}
}
if ($num_failed < 1) {
$this->_systemRespons[$this->_systemReOwner]['action'] = 'phpUserLogin_REG_USER_MADE';
$this->runLog('New user! "'.$this->_systemOutVar['REG']['username'].'" is added to database!');
} else {
$this->_systemRespons[$this->_systemReOwner]['action'] = 'phpUserLogin_REG_USER_MADE_ERROR';
$this->runLog('New user! "'.$this->_systemOutVar['REG']['username'].'" is added to database! Some or all "extra table" data was not added to database!');
}
} else {
$this->_systemRespons[$this->_systemReOwner]['action'] = 'phpUserLogin_REG_USER_MADE';
$this->runLog('New user! "'.$this->_systemOutVar['REG']['username'].'" is added to database!');
}
}
} else {
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_REG_USER_E';
}
}
} else {
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_REG_WRONG_PASS';
}
}
/* User wants to request a new password - Part 1 */
} elseif (isset($this->_systemOutVar['LP']['run']) && $this->URLmatch($this->_systemOptions['page']) && $this->_systemOptions['lostpass'] == TRUE) {
$this->_systemReOwner = 'login';
if ($this->_systemOutVar['LP']['username'] == '') {
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_LOST_MISSING_USER';
} else {
// Anti Spam Counter
$this->spamCount();
if ($result = $this->findUser($this->_systemOutVar['LP']['username'])) {
if ($result['num'] == 1) {
// User did exist.
if ($result['data']['lost_date'] < gmdate("Y-m-d H:i:s")) {
srand(microtime()*100000000);
$random_key = md5(rand(1, 999).$this->_systemOptions['var_name'].rand(1, 999));
if ($this->runQuery("UPDATE ".$this->_systemOptions['mysql_table']." SET lost_key='".$random_key."', lost_date='".gmdate("Y-m-d H:i:s", mktime (gmdate("H"),gmdate("i"),gmdate("s"),gmdate("m"),gmdate("d")+1,gmdate("Y")))."' WHERE ".$this->_systemOptions['mysql_id']." = '".$result['data'][$this->_systemOptions['mysql_id']]."' LIMIT 1")) {
// Made a new key and set a new date
if ($this->sendMail($result['data']['email'], 'Request New Password: Step 1', 'A new password have been requested for the user, '.$result['data']['username'].', you have at this page '.$this->_systemOptions['page'].'
To make a new random password follow this link:
'.$this->checkURL($this->_systemOptions['page']).$this->_systemOptions['var_name'].'[LP][user]='.$result['data']['username'].'&'.$this->_systemOptions['var_name'].'[LP][key]='.$random_key.'
If you did not loose or request a new password, then someone else have entered you username, maybe by mistake.
If you keep getting this mail and you did not ask for it, please contact the webmaster of the website.
Thank you for your time!')) {
$this->_systemRespons[$this->_systemReOwner]['action'] = 'phpUserLogin_EMAIL_SENT';
$this->runLog('"'.$result['data']['username'].'" has requested a new password - Part 1: First email.');
}
}
} else {
// This user have already had a request made within the last day
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_LOST_TO_FAST';
}
} elseif ($result['num'] > 1) {
// To many users with same username
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_LOST_TO_MANY_USERS';
} elseif ($result['num'] < 1) {
// No users with that username
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_LOST_WRONG_USER';
}
}
}
/* User wants to request a new password - Part 2 */
} elseif (isset($this->_systemOutVar['LP']['user']) && isset($this->_systemOutVar['LP']['key']) && $this->_systemOptions['lostpass'] == TRUE) {
$this->_systemReOwner = 'login';
if ($result = $this->findUser($this->_systemOutVar['LP']['user'])) {
if ($result['num'] == 1) {
// User did exist.
if ($result['data']['lost_key'] != '0') {
if ($result['data']['lost_key'] == $this->_systemOutVar['LP']['key']) {
srand(microtime()*100000000);
$random_pass = rand(1, 9).'a'.rand(1, 9).'b'.rand(1, 9).'c'.rand(1, 9);
if ($this->runQuery("UPDATE ".$this->_systemOptions['mysql_table']." SET lost_key='0', password='".md5($random_pass)."' WHERE ".$this->_systemOptions['mysql_id']." = '".$result['data'][$this->_systemOptions['mysql_id']]."' LIMIT 1")) {
if ($this->sendMail($result['data']['email'], 'Request New Password: Step 2', 'A new password have been made for the user, '.$result['data']['username'].', you have at this page '.$this->_systemOptions['page'].'.
The new password is:
'.$random_pass.'
If you did not request this mail, the login system may have been hacked, contact the webmaster ASAP* and tell him what has happend.
Thank you for your time!
* As Soon As Possibal.')) {
$this->_systemRespons[$this->_systemReOwner]['action'] = 'phpUserLogin_EMAIL_SENT';
$this->runLog('"'.$result['data']['username'].'" has requested a new password - Part 2: Secound email with new password.');
} else {
$this->runQuery("UPDATE ".$this->_systemOptions['mysql_table']." SET password='".$result['data']['password']."' WHERE ".$this->_systemOptions['mysql_id']." = '".$result['data'][$this->_systemOptions['mysql_id']]."' LIMIT 1");
}
}
} else {
// The two keys where not the same
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_LOST_WRONG_KEY';
}
} else {
// This user have not requested a new password
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_LOST_NO_REQUEST';
}
} elseif ($result['num'] > 1) {
// To many users with same username
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_LOST_TO_MANY_USERS';
} elseif ($result['num'] < 1) {
// No users with that username
$this->_systemRespons[$this->_systemReOwner]['info'] = 'phpUserLogin_LOST_WRONG_USER';
}
}
}
}
}
/* Checking to see if user is a admin */
if ($this->_systemOptions['admins'] != '' && $this->loginstatus == TRUE) {
$admins = explode(',', $this->_systemOptions['admins']);
for ($i = 0; $i < count($admins); $i++) {
if ($this->userinfo['username'] == $admins[$i]) {
$this->adminstatus = TRUE;
break;
}
}
}
/* ADMIN */
if ($this->loginstatus == TRUE && $this->adminstatus == TRUE && isset($this->_systemOutVar['ADMIN'])) {
$this->_systemReOwner = 'admin';
$this->accessControl($this->_systemOptions['page']);
?>
phpUserLogin Admin - =$this->_systemOptions['var_name']?>
if ($this->_systemOutVar['ADMIN']['ADD'] == 'run') { ?>
if ($this->_systemOutVar['ADMIN']['ADD_run'] == 'Add') { ?>
if (empty($this->_systemOutVar['ADMIN']['ADD_email']) OR empty($this->_systemOutVar['ADMIN']['ADD_username']) OR empty($this->_systemOutVar['ADMIN']['ADD_password'])) {
?>
You must enter something in username, password and email!
} else {
if ($this->_systemOutVar['ADMIN']['ADD_password'] != $this->_systemOutVar['ADMIN']['ADD_password2']) {
?>
The two passwords are not the same!
} else {
$query = "INSERT INTO ".$this->_systemOptions['mysql_table']." (`username`,`password`,`email`) VALUES ('".$this->_systemOutVar['ADMIN']['ADD_username']."','".md5($this->_systemOutVar['ADMIN']['ADD_password'])."','".$this->_systemOutVar['ADMIN']['ADD_email']."')";
if ($result = $this->runQuery($query)) {
for($i = 0; $i <= count($this->_systemOptions['mysql_fields']) && $this->_systemOptions['mysql_fields'] != FALSE; $i++) {
$temp_query = "INSERT INTO ".$this->_systemOptions['mysql_fields'][$i]['table_name'];
$temp_query_f = "(`".$this->_systemOptions['mysql_fields'][$i]['id_field']."`,";
$temp_query_v = "VALUES ('".$result['id']."',";
for($b = 0; $b <= count($this->_systemOptions['mysql_fields'][$i]['fields']); $b++) {
if (isset($this->_systemOptions['mysql_fields'][$i]['fields'][$b])) {
$input = explode('||', $this->_systemOptions['mysql_fields'][$i]['fields'][$b]);
$temp_query_f .= "`".$input[0]."`";
$temp_query_v .= "'".$this->_systemOutVar['ADMIN']['ADD_extra'][$i][$input[0]]."'";
if ($b < count($this->_systemOptions['mysql_fields'][$i]['fields'])) {
$temp_query_f .= ",";
$temp_query_v .= ",";
}
}
}
$temp_query_f .= ")";
$temp_query_v .= ")";
$querys[] = $temp_query." ".$temp_query_f." ".$temp_query_v;
}
$num_q = count($querys);
for($i = 1; $i < $num_q; $i++) {
if (!@mysql_query($querys[$i], $this->_systemMySQL_Link)) {
$failed_q[] = $i;
}
}
if (!isset($failed_q)) {
?>
User Added:
=$num_q?> + 1 querys was run on the database!
} else {
$num_fq = count($failed_q);
?>
Error while adding user:
The user was still added into the main table (=$this->_systemOptions['mysql_table']?>)
=$num_fq?> of the =$num_q?> + 1 querys that was run on the database failed!
List of failed querys!
for($i = 0; $i < $num_fq; $i++) {
echo'Query number '.$failed_q[$i].': '.$querys[$failed_q[$i]].'
';
}
}
} else {
?>
Could not add user, maybe the username is already in use!
}
}
}
?>
} else { ?>
} ?>
Back to main menu
} elseif ($this->_systemOutVar['ADMIN']['EDIT'] == 'run') { ?>
if ($this->_systemOutVar['ADMIN']['EDIT_update'] == 'Update') { ?>
if (!empty($this->_systemOutVar['ADMIN']['EDIT_password'])) {
if ($this->_systemOutVar['ADMIN']['EDIT_password'] == $this->_systemOutVar['ADMIN']['EDIT_password2']) {
$password_string = "password='".md5($this->_systemOutVar['ADMIN']['EDIT_password'])."',";
} else {
?>
The two passwords was not the same!!
}
}
$querys[0] = "UPDATE ".$this->_systemOptions['mysql_table']." SET ".$password_string." email='".$this->_systemOutVar['ADMIN']['EDIT_email']."' WHERE ".$this->_systemOptions['mysql_id']."=".$this->_systemOutVar['ADMIN']['EDIT_id']." LIMIT 1";
for($i = 0; $i <= count($this->_systemOptions['mysql_fields']) && $this->_systemOptions['mysql_fields'] != FALSE; $i++) {
if (isset($this->_systemOptions['mysql_fields'][$i])) {
if ($this->_systemOutVar['ADMIN']['EDIT_error'][$i] != 'yes') {
$temp_query = "UPDATE ".$this->_systemOptions['mysql_fields'][$i]['table_name']." SET";
for($b = 0; $b <= count($this->_systemOptions['mysql_fields'][$i]['fields']); $b++) {
if (isset($this->_systemOptions['mysql_fields'][$i]['fields'][$b])) {
$input = explode('||', $this->_systemOptions['mysql_fields'][$i]['fields'][$b]);
$temp_query .= " ".$input[0]."='".$this->_systemOutVar['ADMIN']['EDIT_extra'][$i][$input[0]]."'";
if ($b < count($this->_systemOptions['mysql_fields'][$i]['fields'])) {
$temp_query .= ",";
}
}
}
$temp_query .= " WHERE ".$this->_systemOptions['mysql_fields'][$i]['id_field']."=".$this->_systemOutVar['ADMIN']['EDIT_id']." LIMIT 1";
} else {
$temp_query = "INSERT INTO ".$this->_systemOptions['mysql_fields'][$i]['table_name'];
$temp_query_f = "(`".$this->_systemOptions['mysql_fields'][$i]['id_field']."`,";
$temp_query_v = "VALUES ('".$this->_systemOutVar['ADMIN']['EDIT_id']."',";
for($b = 0; $b <= count($this->_systemOptions['mysql_fields'][$i]['fields']); $b++) {
if (isset($this->_systemOptions['mysql_fields'][$i]['fields'][$b])) {
$input = explode('||', $this->_systemOptions['mysql_fields'][$i]['fields'][$b]);
$temp_query_f .= "`".$input[0]."`";
$temp_query_v .= "'".$this->_systemOutVar['ADMIN']['EDIT_extra'][$i][$input[0]]."'";
if ($b < count($this->_systemOptions['mysql_fields'][$i]['fields'])) {
$temp_query_f .= ",";
$temp_query_v .= ",";
}
}
}
$temp_query_f .= ")";
$temp_query_v .= ")";
}
$querys[] = $temp_query." ".$temp_query_f." ".$temp_query_v;
}
}
$num_q = count($querys);
for($i = 0; $i < $num_q; $i++) {
if (!@mysql_query($querys[$i], $this->_systemMySQL_Link)) {
$failed_q[] = $i;
}
}
if (!isset($failed_q)) {
?>
User Updated:
=$num_q?> querys was run on the database!
} else {
$num_fq = count($failed_q);
?>
Error while updating user:
=$num_fq?> of the =$num_q?> querys that was run on the database failed!
List of failed querys!
for($i = 0; $i < $num_fq; $i++) {
echo'Query number '.$failed_q[$i].': '.$querys[$failed_q[$i]].'
';
}
} ?>
} elseif ($this->_systemOutVar['ADMIN']['EDIT_run'] == 'Edit' && isset($this->_systemOutVar['ADMIN']['EDIT_id'])) { ?>
if ($result = $this->runQuery("SELECT * FROM ".$this->_systemOptions['mysql_table']." WHERE ".$this->_systemOptions['mysql_id']."=".$this->_systemOutVar['ADMIN']['EDIT_id'])) {
if ($result['num'] == 1) {
?>
} else {
?>
Could not find the selected user in the database OR there was found to many users with the same id!
}
}
?>
} else { ?>
if ($result = $this->runQuery("SELECT * FROM ".$this->_systemOptions['mysql_table'])) {
if ($result['num'] > 0) {
?>
} else {
?>
Could not find any users in the database!
}
}
?>
} ?>
Back to main menu
} elseif ($this->_systemOutVar['ADMIN']['DELETE'] == 'run') { ?>
if ($this->_systemOutVar['ADMIN']['DELETE_run'] == 'Delete' && isset($this->_systemOutVar['ADMIN']['DELETE_id'])) { ?>
$querys[0] = "DELETE FROM ".$this->_systemOptions['mysql_table']." WHERE ".$this->_systemOptions['mysql_id']."=".$this->_systemOutVar['ADMIN']['DELETE_id'];
for($i = 0; $i <= count($this->_systemOptions['mysql_fields']) && $this->_systemOptions['mysql_fields'] != FALSE; $i++) {
if (isset($this->_systemOptions['mysql_fields'][$i])) {
$temp_query = "DELETE FROM ".$this->_systemOptions['mysql_fields'][$i]['table_name']." WHERE ".$this->_systemOptions['mysql_fields'][$i]['id_field']."=".$this->_systemOutVar['ADMIN']['DELETE_id'];
if ($this->_systemOptions['mysql_fields'][$i]['extra'] != '') {
$temp_query .= ", ".$this->_systemOptions['mysql_fields'][$i]['extra'];
}
$querys[] = $temp_query;
}
}
$num_q = count($querys);
for($i = 0; $i < $num_q; $i++) {
if (!@mysql_query($querys[$i], $this->_systemMySQL_Link)) {
$failed_q[] = $i;
}
}
if (!isset($failed_q)) {
?>
User Deleted:
=$num_q?> querys was run on the database!
} else {
$num_fq = count($failed_q);
?>
Error while deleting user:
=$num_fq?> of the =$num_q?> querys that was run on the database failed!
List of failed querys!
for($i = 0; $i < $num_fq; $i++) {
echo'Query number '.$failed_q[$i].': '.$querys[$failed_q[$i]].'
';
}
?>
Note: If query 0 failed then the user entry in the "main" table will still be there and the user will still be able to login!!!
} ?>
} else { ?>
if ($result = $this->runQuery("SELECT * FROM ".$this->_systemOptions['mysql_table'])) {
if ($result['num'] > 0) {
?>
} else {
?>
Could not find any users in the database!
}
}
?>
} ?>
Back to main menu
} elseif ($this->_systemOutVar['ADMIN']['LOGFILE'] == 'run' && !empty($this->_systemOptions['logFile'])) { ?>
Log File
if (@$admin_log_fp = fopen ($this->_systemOptions['logFile'], "rb")) {
@fwrite($admin_log_fp, gmdate("M-d-Y H:i:s").' | '.$log_entry.' | '.$_SERVER['REMOTE_ADDR'].'');
@$log_output = fread ($admin_log_fp, filesize($this->_systemOptions['logFile']));
@fclose($admin_log_fp);
if ($log_output != '') {
$log_explode = explode("\n", $log_output);
$log_explode = array_reverse($log_explode);
?>
Newest log first.
Date and time: |
IP of user: |
Log entry text: |
$i = 1;
$color = 1;
$log_count = count($log_explode);
while ($i <= $log_count) {
list($log_date,$log_ip,$log_entry) = explode(' | ', $log_explode[$i]);
echo'
'.$log_date.' |
'.$log_ip.' |
'.$log_entry.' |
';
$i++;
}
?>
} else {
?>
Log was empty.
}
} else {
?>
Could not open log file.
}
?>
Back to main menu
} else { ?>
Add a new user -
Edit an excisting user -
Delete an excisting user if (!empty($this->_systemOptions['logFile'])) {?> -
Show log file } ?>
} ?>
echo $this->SystemMsg('admin'); ?>
Exit
$this->printForm();
?>
phpUserLogin
Version: =$this->_systemVersion?>
The phpUserLogin script code is (©)2002 Tanny 'Drakxter' Lund
The name phpUserLogin is (©)2002 Tanny 'Drakxter' Lund

exit;
}
/* Run time counter - End */
$this->_systemRunTime['end'] = microtime();
}
function loadMore($table_name, $id_field = 'id') {
if ($this->loginstatus) {
$query = "SELECT * FROM ".$table_name." WHERE ".$id_field." = '".$this->userinfo["id"]."'";
$result = @mysql_query($query, $this->_systemMySQL_Link);
$num = @mysql_num_rows($result);
if ($num == 1) {
$this->userinfo[$table_name] = mysql_fetch_assoc($result);
return TRUE;
} elseif ($num < 1) {
return FALSE;
} elseif ($num > 1) {
echo$this->_systemText['loadMore_bigerror'];
return FALSE;
}
}
}
function accessControl($back_page, $check = FALSE, $table_name = NULL, $field_check = NULL, $ok_value = TRUE, $field_id = 'id') {
/* Checking that headers have not already been sent */
$this->checkHeaders();
$test_result = NULL;
if ($this->loginstatus == TRUE) {
if ($check == TRUE) {
if (!isset($this->userinfo[$table_name][$field_check])) {
if (!$this->loadMore($table_name, $field_id)) {
$test_result = FALSE;
}
}
if ($test_result == NULL) {
$ok_value = explode(',', $ok_value);
if (is_array($ok_value)) {
for ($i = 0; $i < count($ok_value); $i++) {
if ($this->userinfo[$table_name][$field_check] == $ok_value[$i]) {
$test_result = TRUE;
break;
} elseif (($i+1) == count($ok_value)) {
$test_result = FALSE;
break;
}
}
} else {
if ($this->userinfo[$table_name][$field_check] == $ok_value) {
$test_result = TRUE;
} else {
$test_result = FALSE;
}
}
}
} else {
$test_result = TRUE;
}
} else {
$test_result = FALSE;
}
if ($test_result == FALSE || $test_result == NULL) {
header('Refresh: 5; url='.$back_page);
echo'
'.$this->_systemText['aC_1'].' '.$this->_systemText['aC_2'].'.';
exit;
}
}
function SystemMsg($ResponsOwner = 'login') {
$text = '';
$msg_check = 0;
if (isset($this->_systemRespons['spam'])) {
return $this->_systemText['SPAM'];
} elseif (isset($this->_systemRespons[$ResponsOwner])) {
if (isset($this->_systemRespons[$ResponsOwner]['mysql'])) {
$msg_check = 1;
switch ($this->_systemRespons[$ResponsOwner]['mysql']) {
case 'phpUserLogin_MySQL_NO_CON':
$text .= $this->_systemText['MYSQL_NO_CON'];
break;
case 'phpUserLogin_MySQL_NO_CON_P':
$text .= $this->_systemText['MYSQL_NO_CON_P'];
break;
case 'phpUserLogin_MySQL_NO_DATAB':
$text .= $this->_systemText['MYSQL_NO_DATAB'].' '.$this->_systemOptions['mysql_data'];
break;
case 'phpUserLogin_MySQL_QUERY_ERROR':
$text .= $this->_systemText['MYSQL_QUERY_ERROR'];
break;
default:
$text .= $this->_systemText['ERROR_MISSING_MSG'].': '.$this->_systemRespons[$ResponsOwner]['mysql'];
break;
}
}
if (isset($this->_systemRespons[$ResponsOwner]['info'])) {
if ($msg_check == 1) {
$text .= '
';
}
$msg_check = 1;
switch ($this->_systemRespons[$ResponsOwner]['info']) {
case 'phpUserLogin_REG_MISSING_USER':
$text .= $this->_systemText['REG_MISSING_USER'];
break;
case 'phpUserLogin_REG_MISSING_PASS':
$text .= $this->_systemText['REG_MISSING_PASS'];
break;
case 'phpUserLogin_REG_MISSING_EMAIL':
$text .= $this->_systemText['REG_MISSING_EMAIL'];
break;
case 'phpUserLogin_REG_WRONG_PASS':
$text .= $this->_systemText['REG_WRONG_PASS'];
break;
case 'phpUserLogin_REG_USER_E':
$text .= $this->_systemText['REG_USER_E'];
break;
case 'phpUserLogin_LOGIN_MISSING_USER':
$text .= $this->_systemText['LOGIN_MISSING_USER'];
break;
case 'phpUserLogin_LOGIN_MISSING_PASS':
$text .= $this->_systemText['LOGIN_MISSING_PASS'];
break;
case 'phpUserLogin_LOGIN_TO_MANY_USERS':
$text .= $this->_systemText['LOGIN_TO_MANY_USERS'];
break;
case 'phpUserLogin_LOGIN_WRONG_USER':
$text .= $this->_systemText['LOGIN_WRONG_USER'];
break;
case 'phpUserLogin_LOGIN_WRONG_PASS':
$text .= $this->_systemText['LOGIN_WRONG_PASS'];
break;
case 'phpUserLogin_COOKIES_FAKE':
$text .= $this->_systemText['COOKIES_FAKE'];
break;
case 'phpUserLogin_COOKIES_NO_USER':
$text .= $this->_systemText['COOKIES_NO_USER'];
break;
case 'phpUserLogin_COOKIES_TO_MANY_USERS':
$text .= $this->_systemText['COOKIES_TO_MANY_USERS'];
break;
case 'phpUserLogin_COOKIES_LOGGED_IN':
$text .= $this->_systemText['COOKIES_LOGGED_IN'];
break;
case 'phpUserLogin_LOST_MISSING_USER':
$text .= $this->_systemText['LOST_MISSING_USER'];
break;
case 'phpUserLogin_LOST_TO_MANY_USERS':
$text .= $this->_systemText['LOST_TO_MANY_USERS'];
break;
case 'phpUserLogin_LOST_WRONG_USER':
$text .= $this->_systemText['LOST_WRONG_USER'];
break;
case 'phpUserLogin_LOST_TO_FAST':
$text .= $this->_systemText['LOST_TO_FAST'];
break;
case 'phpUserLogin_LOST_NO_REQUEST':
$text .= $this->_systemText['LOST_NO_REQUEST'];
break;
case 'phpUserLogin_LOST_WRONG_KEY':
$text .= $this->_systemText['LOST_WRONG_KEY'];
break;
case 'phpUserLogin_EMAIL_NONE':
$text .= $this->_systemText['EMAIL_NONE'];
break;
case 'phpUserLogin_EMAIL_NO_GO':
$text .= $this->_systemText['EMAIL_NO_GO'];
break;
default:
$text .= $this->_systemText['ERROR_MISSING_MSG'].': '.$this->_systemRespons[$ResponsOwner]['info'];
break;
}
}
if (isset($this->_systemRespons[$ResponsOwner]['action'])) {
if ($msg_check == 1) {
$text .= '
';
}
$text .= '
';
switch ($this->_systemRespons[$ResponsOwner]['action']) {
case 'phpUserLogin_REG_USER_MADE':
$text .= $this->_systemText['REG_USER_MADE'];
break;
case 'phpUserLogin_REG_USER_MADE_ERROR':
$text .= $this->_systemText['REG_USER_MADE_ERROR'];
break;
case 'phpUserLogin_LOGOUT_FORCE':
$text .= $this->_systemText['LOGOUT_FORCE'];
break;
case 'phpUserLogin_LOGOUT_USER':
$text .= $this->_systemText['LOGOUT_USER'];
break;
case 'phpUserLogin_LOGIN_USER':
$text .= $this->_systemText['LOGIN_USER'];
break;
case 'phpUserLogin_EMAIL_SENT':
$text .= $this->_systemText['EMAIL_SENT'];
break;
default:
$text .= $this->_systemText['ERROR_MISSING_MSG'].': '.$this->_systemRespons[$ResponsOwner]['action'];
break;
}
$text .= '';
}
return $text;
} else {
return FALSE;
}
}
function URLmatch($check_page, $this_page = '') {
if ($this->_systemPathMatch == TRUE) {
if (empty($this_page)) {
$this_page = PHPUSERLOGIN_PAGE;
}
$this_page = @parse_url($this_page);
$check_page = @parse_url($check_page);
if ($this_page['path'] == $check_page['path']) {
if (isset($this_page['host']) & isset($check_page['host'])){
if ($this_page['host'] == $check_page['host']) {
return TRUE;
} else {
return FALSE;
}
}
return TRUE;
} else {
return FALSE;
}
} else {
return TRUE;
}
}
function checkURL($url) {
$url_parse = @parse_url($url);
if (!empty($url_parse['query'])) {
$end_char = '&';
} else {
$end_char = '?';
}
return $url.$end_char;
}
function printRegForm() {
echo'
';
if ($this->_systemOptions['register'] == TRUE) {
if ($this->URLmatch($this->_systemOptions['register_page'])) {
if ($this->loginstatus == FALSE) {
if (isset($this->_systemOutVar['REG']['register'])) {
echo$this->SystemMsg('register');
} else {
echo$this->_systemText['regForm_6'].'';
echo'
';
}
} else {
echo$this->_systemText['regForm_7'];
}
} else {
echo$this->_systemText['regForm_8'];
}
} else {
echo$this->_systemText['regForm_9'];
}
echo'
'.$this->_systemTextPower.'';
?>
}
function printForm() {
echo'
';
/* Print System msgs */
if ($msg = $this->SystemMsg()) {
echo''.$msg.' |
';
}
/* If logged in */
if ($this->loginstatus) {
/* Print logout link */
echo'';
echo''.$this->_systemText['Form_1'].'';
if ($this->adminstatus == TRUE) {
echo' '.$this->_systemText['Form_10'].'';
}
echo' |
';
/* If not logged in */
} else {
echo'';
if ($this->URLmatch($this->_systemOptions['page'])) {
if (isset($this->_systemOutVar['LP']['form']) && $this->_systemOptions['lostpass'] == TRUE) {
/* Print start of form and table */
echo'';
} else {
/* Print start of form and table */
echo'';
}
} else {
echo''.$this->_systemText['Form_9'].'';
}
echo' |
';
}
if ($this->_systemDebug == TRUE) {
$temp_options = $this->_systemOptions;
$temp_options['mysql_pass'] = '***';
$temp_options['hidden_key'] = '***';
$start_time = explode(" ", $this->_systemRunTime['start']);
$start_time = $start_time[1] + $start_time[0];
$end_time = explode(" ", $this->_systemRunTime['end']);
$end_time = $end_time[1] + $end_time[0];
$total_time = round(($end_time - $start_time), 4);
?>
Debug Mode Activated:
Script Version: =$this->_systemVersion?>
Script Options:
print_r($temp_options) ?>
MySQL Error(s):
if ($this->_systemMySQL_Err == NULL) { echo'No Errors'; } else { print_r($this->_systemMySQL_Err); } ?>
Time used to run code in constructor:
=$total_time?> Secounds Time used cant be counted while using the admin.
Vars from outside php:
print_r($this->_systemOutVar) ?>
Login status: =(($this->loginstatus == FALSE) ? 'Not logged in' : 'Logged in Admin status: '.(($this->adminstatus == FALSE) ? 'Not an admin' : 'Is admin'))?>
Data stored in userinfo:
print_r($this->userinfo) ?>
|
}
?>
echo''.$this->_systemTextPower.' |
';
if (!empty($this->_systemOptions['logFile'])) {
echo''.$this->_systemText['log_on'].' |
';
}
echo'
';
}
/* End of Class */
}
/*
* Data
// MySQL Database Dump //
CREATE TABLE phpuserlogin_users (
id int(11) NOT NULL auto_increment,
username varchar(20) NOT NULL default '',
password varchar(100) NOT NULL default '',
email varchar(100) default NULL,
lost_key varchar(60) NOT NULL default '0',
lost_date datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (id),
UNIQUE KEY username (username)
)
// Special Option
'mysql_fields' => array(
1 => array(
'table_name' => 'extra_table',
'id_field' => 'id',
'extra' => '',
'fields' => array(
1 => 'extra_test||This is a extra field',
2 => 'extra_2||This is another extra fields, very fun, dont you think'
3 => 'extra_3||Make your chose|DROP_DOWN[test1=1,test2=2,test3=3]'
4 => 'extra_4||User level|AUTO[1]'
5 => 'extra_5||Do you want others to see your email|ON_OFF[1,0,1]'
6 => 'extra_6||What do you like:|RADIO[Men=1,Females=2,Ice=3]'
)
)
),
*/
?>