// All fine
$ret = 'done';
} else {
- // Set status
+ // Did not match!
$ret = 'password';
}
} // END - if
// Build a special template list
function adminListBuilder ($listType, $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $userid = 'userid') {
+ // $table and $idColumn must bove be arrays!
+ if (!is_array($table)) {
+ // $table is no array
+ debug_report_bug(__FUNCTION__, __LINE__, 'table[]=' . gettype($table) . '!=array');
+ } elseif (!is_array($idColumn)) {
+ // $idColumn is no array
+ debug_report_bug(__FUNCTION__, __LINE__, 'idColumn[]=' . gettype($idColumn) . '!=array');
+ }
+
$OUT = '';
// "Walk" through all entries
$id = bigintval($id);
// Get result from a given column array and table name
- $result = SQL_RESULT_FROM_ARRAY($table, $columns, $idColumn, $id, __FUNCTION__, __LINE__);
+ $result = SQL_RESULT_FROM_ARRAY($table[0], $columns, $idColumn[0], $id, __FUNCTION__, __LINE__);
// Is there one entry?
if (SQL_NUMROWS($result) == 1) {
// Then list it
$OUT .= loadTemplate(sprintf("admin_%s_%s_row",
$listType,
- $table
+ $table[0]
), true, $content
);
} // END - if
// Load master template
loadTemplate(sprintf("admin_%s_%s",
$listType,
- $table
+ $table[0]
), false, $OUT
);
}
// Generate hash (we already check for sql_patches in generateHash())
$passHash = generateHash($password);
+ // Prepare fake POST data
+ $postData = array(
+ 'login' => array(getAdminId($login) => $login),
+ 'password' => array(getAdminId($login) => $passHash),
+ );
+
// Update database
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admins` SET `password`='%s' WHERE `login`='%s' LIMIT 1",
- array($passHash, $login), __FUNCTION__, __LINE__);
+ $message = adminsChangeAdminAccount($postData, '', false);
// Run filters
- runFilterChain('post_form_reset_pass', array('login' => $login, 'hash' => $passHash));
+ runFilterChain('post_form_reset_pass', array('login' => $login, 'hash' => $passHash, 'message' => $message));
// Return output
return '{--ADMIN_PASSWORD_RESET_DONE--}';