2010-10-27 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_db.php: in function "pandora_audit" clean source code style, use the Pandora DB interface and now return id the row in tsesion. * index.php: fixed when login failed the audit. * godmode/users/user_list.php: clean source code style. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3468 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
2cc17edf55
commit
a0b29acf00
|
@ -1,3 +1,12 @@
|
|||
2010-10-27 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_db.php: in function "pandora_audit" clean source code
|
||||
style, use the Pandora DB interface and now return id the row in tsesion.
|
||||
|
||||
* index.php: fixed when login failed the audit.
|
||||
|
||||
* godmode/users/user_list.php: clean source code style.
|
||||
|
||||
2010-10-27 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/admin_access_logs.php: added hooks to enterprise code, and added
|
||||
|
|
|
@ -104,7 +104,8 @@ if (isset ($_GET["user_del"])) { //delete user
|
|||
else
|
||||
print_error_message (__('There was a problem deleting the user'));
|
||||
|
||||
} elseif (isset ($_GET["profile_del"])) { //delete profile
|
||||
}
|
||||
elseif (isset ($_GET["profile_del"])) { //delete profile
|
||||
$id_profile = (int) get_parameter_post ("delete_profile");
|
||||
$result = delete_profile ($id_profile);
|
||||
print_result_message ($result,
|
||||
|
|
|
@ -306,8 +306,10 @@ function safe_acl_group ($id_user, $id_groups, $access) {
|
|||
* @param string $descripcion Long action description
|
||||
* @param string $id User id, by default is the user that login.
|
||||
* @param string $ip The ip to make the action, by default is $_SERVER['REMOTE_ADDR'] or $config["remote_addr"]
|
||||
*
|
||||
* @return int Return the id of row in tsesion or false in case of fail.
|
||||
*/
|
||||
function pandora_audit ($accion, $descripcion, $user_id = false, $ip = false){
|
||||
function pandora_audit ($accion, $descripcion, $user_id = false, $ip = false) {
|
||||
global $config;
|
||||
|
||||
if ($ip !== false) {
|
||||
|
@ -334,8 +336,15 @@ function pandora_audit ($accion, $descripcion, $user_id = false, $ip = false){
|
|||
|
||||
$accion = safe_input($accion);
|
||||
$descripcion = safe_input($descripcion);
|
||||
$sql = sprintf ("INSERT INTO tsesion (ID_usuario, accion, fecha, IP_origen,descripcion, utimestamp) VALUES ('%s','%s',NOW(),'%s','%s',UNIX_TIMESTAMP(NOW()))",$id,$accion,$ip,$descripcion);
|
||||
process_sql ($sql);
|
||||
|
||||
$values = array('ID_usuario' => $id,
|
||||
'accion' => $accion,
|
||||
'IP_origen' => $ip,
|
||||
'descripcion' => $descripcion,
|
||||
'fecha' => date('Y-m-d H:i:s'),
|
||||
'utimestamp' => time());
|
||||
|
||||
return process_sql_insert('tsesion', $values);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -167,14 +167,14 @@ elseif (! isset ($config['id_user']) && isset ($_GET["login"])) {
|
|||
// It accepts username and password. The rest should be internal to the auth file.
|
||||
// The auth file can set $config["auth_error"] to an informative error output or reference their internal error messages to it
|
||||
// process_user_login should return false in case of errors or invalid login, the nickname if correct
|
||||
$nick = process_user_login ($nick, $pass);
|
||||
$nick_in_db = process_user_login ($nick, $pass);
|
||||
|
||||
if ($nick !== false) {
|
||||
if ($nick_in_db !== false) {
|
||||
unset ($_GET["sec2"]);
|
||||
$_GET["sec"] = "general/logon_ok";
|
||||
logon_db ($nick, $_SERVER['REMOTE_ADDR']);
|
||||
$_SESSION['id_usuario'] = $nick;
|
||||
$config['id_user'] = $nick;
|
||||
logon_db ($nick_in_db, $_SERVER['REMOTE_ADDR']);
|
||||
$_SESSION['id_usuario'] = $nick_in_db;
|
||||
$config['id_user'] = $nick_in_db;
|
||||
//Remove everything that might have to do with people's passwords or logins
|
||||
unset ($_GET['pass'], $pass, $_POST['pass'], $_REQUEST['pass'], $login_good);
|
||||
|
||||
|
|
Loading…
Reference in New Issue