//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'adminLogin=' . $adminLogin . ',passHash='.$passHash.',adminHash='.$adminHash.',testHash='.$testHash);
// If they both match, the login data is valid
- if ($testHash == $passHash) {
+ if ($testHash != $passHash) {
+ // Passwords don't match
+ $ret = 'password';
+ } elseif (!isAdmin()) {
+ // Is not valid session
+ $ret = 'session';
+ } else {
// All fine
$ret = 'done';
- } else {
- // Set status
- $ret = 'password';
}
} // END - if
// Load all entries
while ($content = SQL_FETCHARRAY($result)) {
+ // Default is none
+ $content['default'] = '';
+
+ // Is the id the same?
+ if ($content['id'] == $adminId) {
+ // Set this as default
+ $content['default'] = ' selected="selected"';
+ } // END - if
+
// Add the entry
$OUT .= loadTemplate('select_admins_option', TRUE, $content);
} // END - if
while ($content = SQL_FETCHARRAY($result)) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . intval($userid) . '/' . $content['userid']);
$OUT .= '<option value="' . bigintval($content['userid']) . '"';
- if (bigintval($userid) === bigintval($content['userid'])) {
+ if (bigintval($userid, FALSE, FALSE) === bigintval($content['userid'])) {
$OUT .= ' selected="selected"';
} // END - if
$OUT .= '>' . $content['surname'] . ' ' . $content['family'] . ' (' . bigintval($content['userid']) . ')</option>';
$skip = FALSE;
// Now, walk through all entries and prepare them for saving
- //* BUG: */ reportBug(__FUNCTION__, __LINE__, '<pre>'.print_r(postRequestArray(),true).'</pre>');
+ //* BUG: */ reportBug(__FUNCTION__, __LINE__, '<pre>'.print_r(postRequestArray(), TRUE).'</pre>');
foreach ($postData as $id => $val) {
// Process only formular field but not submit buttons ;)
- if ($id == 'ok') {
+ if ($id =='save_config') {
// Skip this button
continue;
} // END - if
// Is what set?
if (empty($what)) {
- // Then get it
- $what = getWhat();
+ // Then get it to 'list_user'
+ $what = 'list_user';
} // END - if
if (($title == '0') && ($what == 'list_refs')) {
}
// Build a special template list
-function adminListBuilder ($listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId = array('userid')) {
+// @TODO cacheFiles is not yet supported
+function adminListBuilder ($listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId = array('userid'), $content = array()) {
// Call inner (general) function
- doGenericListBuilder('admin', $listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId);
+ doGenericListBuilder('admin', $listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId, $content);
}
// Change status of "build" list
}
// Delete rows by given id numbers
-function adminDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $deleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array()) {
+function adminDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $deleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array(), $content = array()) {
// $tableName must be an array
if ((!is_array($tableName)) || (count($tableName) != 1)) {
// No tableName specified
}
} else {
// List for deletion confirmation
- adminListBuilder('delete', $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn);
+ adminListBuilder('delete', $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId, $content);
}
}
// Edit rows by given id numbers
-function adminEditEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $editNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array()) {
+function adminEditEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $editNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array(), $content = array()) {
// $tableName must be an array
if ((!is_array($tableName)) || (count($tableName) != 1)) {
// No tableName specified
}
} else {
// List for editing
- adminListBuilder('edit', $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn);
+ adminListBuilder('edit', $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId, $content);
}
}
// Un-/lock rows by given id numbers
+// @TODO rawUserId/content is not yet supported
function adminLockEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $statusArray = array(), $lockNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid')) {
// $tableName must be an array
if ((!is_array($tableName)) || (count($tableName) != 1)) {
}
// Undelete rows by given id numbers
+// @TODO rawUserId/cacheFiles/content is not yet supported
function adminUndeleteEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $statusArray = array(), $undeleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid')) {
// $tableName must be an array
if ((!is_array($tableName)) || (count($tableName) != 1)) {