$add = runFilterChain('sql_admin_extra_data');
// Get password from DB
- $result = SQL_QUERY_ESC("SELECT password" . $add . " FROM `{!_MYSQL_PREFIX!}_admins` WHERE `id`=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `password`" . $add . " FROM `{!_MYSQL_PREFIX!}_admins` WHERE `id`=%s LIMIT 1",
array($aid), __FUNCTION__, __LINE__);
// Entry found?
SQL_FREERESULT($result);
}
- //* DEBUG: */ echo "*".$data['password'].'/'.md5($password).'/'.$ret."<br />";
+ //* DEBUG: */ OUTPUT_HTML("*".$data['password'].'/'.md5($password).'/'.$ret."<br />");
if ((isset($data['password'])) && (strlen($data['password']) == 32) && ($data['password'] == md5($password))) {
// Generate new hash
$data['password'] = generateHash($password);
$salt = __SALT;
// Check if password is same
- //* DEBUG: */ echo "*".$ret.','.$data['password'].','.$password.','.$salt."*<br >\n";
+ //* DEBUG: */ OUTPUT_HTML("*".$ret.','.$data['password'].','.$password.','.$salt."*<br />");
if (($ret == 'pass') && ($data['password'] == generateHash($password, $salt)) && ((!empty($salt))) || ($data['password'] == $password)) {
// Re-hash the plain passord with new random salt
$data['password'] = generateHash($password);
$pass = GET_ADMIN_HASH(GET_ADMIN_ID($admin_login));
if ($pass != '-1') $ret = 'pass';
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):".generatePassString($pass).'('.strlen($pass).")/".$password.'('.strlen($password).")<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):".generatePassString($pass).'('.strlen($pass).")/".$password.'('.strlen($password).")<br />");
// Check if password matches
if (($ret == 'pass') && ((generatePassString($pass) == $password) || ($pass == $password) || ((strlen($pass) == 32) && (md5($password) == $pass)))) {
//
function ADMIN_DO_ACTION ($wht) {
global $DATA;
- //* DEBUG: */ echo __LINE__."*".$wht.'/'.getModule().'/'.getAction().'/'.getWhat()."*<br />\n";
+ //* DEBUG: */ OUTPUT_HTML(__LINE__."*".$wht.'/'.getModule().'/'.getAction().'/'.getWhat()."*<br />");
// Remove any spaces from variable
if (empty($wht)) {
if (($menu == $act) && (empty($wht))) {
$OUT .= "<strong>";
} else {
- $OUT .= "[<a href=\"{!URL!}/modules.php?module=admin&action=".$menu."\">";
+ $OUT .= "[<a href=\"{?URL?}/modules.php?module=admin&action=".$menu."\">";
}
$OUT .= $title;
if ($wht == $wht_sub) {
$OUT .= "<strong>";
} else {
- $OUT .= "[<a href=\"{!URL!}/modules.php?module=admin&what=".$wht_sub."\">";
+ $OUT .= "[<a href=\"{?URL?}/modules.php?module=admin&what=".$wht_sub."\">";
}
} else {
$OUT .= "<em class=\"admin_note\">";
// Is this a PHP script?
if ((!isDirectory($file)) && (strpos($file, "".$type.'-') > -1) && (strpos($file, '.php') > 0)) {
// Then test if the file is readable
- $test = sprintf("%sinc/modules/%s/%s", constant('PATH'), $menu, $file);
+ $test = sprintf("inc/modules/%s/%s", $menu, $file);
// Is the file there?
- if (isFileReadable($test)) {
+ if (isIncludeReadable($test)) {
// Extract the value for what=xxx
$part = substr($file, (strlen($type) + 1));
$part = substr($part, 0, -4);
}
// Creates a user-profile link for the admin. This function can also be used for many other purposes
-function generateUserProfileLink ($uid, $title = '', $wht="list_user") {
+function generateUserProfileLink ($uid, $title = '', $wht = 'list_user') {
if (($title == '') && ($title != '0')) {
// Set userid as title
$title = $uid;
} // END - if
- if (($title == '0') && ($wht == "list_refs")) {
+ if (($title == '0') && ($wht == 'list_refs')) {
// Return title again
return $title;
} // END - if
- //* DEBUG: */ echo "a:".$title."<br />";
// Return link
- return "<a href=\"{!URL!}/modules.php?module=admin&what=".$wht."&uid=".$uid."\" title=\"{--ADMIN_USER_PROFILE_TITLE--}\">".$title."</a>";
+ //* DEBUG: */ OUTPUT_HTML("a:".$title."<br />");
+ return "<a href=\"{?URL?}/modules.php?module=admin&what=".$wht."&uid=".$uid."\" title=\"{--ADMIN_USER_PROFILE_TITLE--}\">".$title."</a>";
}
// Check "logical-area-mode"
// Is the userid set correctly?
if ($uid > 0) {
// Create a link to that profile
- return '{!URL!}/modules.php?module=admin&what=list_user&uid='.bigintval($uid);
+ return '{?URL?}/modules.php?module=admin&what=list_user&uid='.bigintval($uid);
} // END - if
// Return a link to the user list
- return '{!URL!}/modules.php?module=admin&what=list_user';
+ return '{?URL?}/modules.php?module=admin&what=list_user';
}
//