Ajout d'une fonction pour get_uid_by_login en php
Test pour eviter de lever des errerurs lorsqu'on utilise le cli
This commit is contained in:
parent
5ea431a421
commit
b260ab4ff9
|
@ -145,6 +145,17 @@ class m_admin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# return the uid of an alternc account
|
||||||
|
function get_uid_by_login($login) {
|
||||||
|
global $db;
|
||||||
|
$db->query("SELECT uid FROM membres WHERE login='$login';");
|
||||||
|
if (! $db->next_record()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return $db->f('uid');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------------- */
|
/* ----------------------------------------------------------------- */
|
||||||
/** Returns the known information about a hosted account
|
/** Returns the known information about a hosted account
|
||||||
*
|
*
|
||||||
|
|
|
@ -613,6 +613,7 @@ Cordially.
|
||||||
|
|
||||||
function session_tempo_params_get($v) {
|
function session_tempo_params_get($v) {
|
||||||
global $uid;
|
global $uid;
|
||||||
|
if (empty($_COOKIE['session'])) return false;
|
||||||
$sid=$_COOKIE['session'];
|
$sid=$_COOKIE['session'];
|
||||||
if ( empty($_SESSION[$sid.'-'.$uid]) ) { // si pas de session de params tempo
|
if ( empty($_SESSION[$sid.'-'.$uid]) ) { // si pas de session de params tempo
|
||||||
return false;
|
return false;
|
||||||
|
@ -627,6 +628,7 @@ Cordially.
|
||||||
|
|
||||||
function session_tempo_params_set($k, $v, $ecrase=false) {
|
function session_tempo_params_set($k, $v, $ecrase=false) {
|
||||||
global $uid;
|
global $uid;
|
||||||
|
if (empty($_COOKIE['session'])) return false;
|
||||||
$sid=$_COOKIE['session'];
|
$sid=$_COOKIE['session'];
|
||||||
$p=Array();
|
$p=Array();
|
||||||
if ( ! empty($_SESSION[$sid.'-'.$uid]) ) {
|
if ( ! empty($_SESSION[$sid.'-'.$uid]) ) {
|
||||||
|
|
Loading…
Reference in New Issue