projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixes wrong call to uid.
[platal.git]
/
modules
/
admin.php
diff --git
a/modules/admin.php
b/modules/admin.php
index
341d21c
..
bc6f097
100644
(file)
--- a/
modules/admin.php
+++ b/
modules/admin.php
@@
-132,7
+132,8
@@
class AdminModule extends PLModule
function _getDays($year, $month)
{
// give a 'no filter' option
function _getDays($year, $month)
{
// give a 'no filter' option
- $months[0] = "----";
+ $days = array();
+ $days[0] = "----";
if ($year && $month) {
$day_max = Array(-1, 31, checkdate(2, 29, $year) ? 29 : 28 , 31,
if ($year && $month) {
$day_max = Array(-1, 31, checkdate(2, 29, $year) ? 29 : 28 , 31,
@@
-174,6
+175,7
@@
class AdminModule extends PLModule
function _getMonths($year)
{
// give a 'no filter' option
function _getMonths($year)
{
// give a 'no filter' option
+ $months = array();
$months[0] = "----";
if ($year) {
$months[0] = "----";
if ($year) {
@@
-206,6
+208,7
@@
class AdminModule extends PLModule
function _getYears()
{
// give a 'no filter' option
function _getYears()
{
// give a 'no filter' option
+ $years = array();
$years[0] = "----";
// retrieve available years
$years[0] = "----";
// retrieve available years
@@
-236,7
+239,7
@@
class AdminModule extends PLModule
$where = array();
if ($uid)
$where = array();
if ($uid)
- array_push($where, "uid='$uid'");
+ array_push($where, "
s.
uid='$uid'");
// we were given at least a year
if ($year) {
// we were given at least a year
if ($year) {
@@
-374,8
+377,10
@@
class AdminModule extends PLModule
}
// Loads the user identity using the environment.
}
// Loads the user identity using the environment.
- $user = User::get($login);
- if (!$user) {
+ if ($login) {
+ $user = User::get($login);
+ }
+ if (empty($user)) {
return;
}
return;
}
@@
-391,11
+396,11
@@
class AdminModule extends PLModule
}
// Handles specific requests (AX sync, su, ...).
}
// Handles specific requests (AX sync, su, ...).
- if(Post::has('log
s
_account')) {
+ if(Post::has('log_account')) {
pl_redirect("admin/logger?loguser=$login&year=".date('Y')."&month=".date('m'));
}
pl_redirect("admin/logger?loguser=$login&year=".date('Y')."&month=".date('m'));
}
- if(Post::has('su_
button
') && $registered) {
+ if(Post::has('su_
account
') && $registered) {
if (!Platal::session()->startSUID($user)) {
$page->trigError('Impossible d\'effectuer un SUID sur ' . $user->login());
} else {
if (!Platal::session()->startSUID($user)) {
$page->trigError('Impossible d\'effectuer un SUID sur ' . $user->login());
} else {
@@
-433,8
+438,8
@@
class AdminModule extends PLModule
if (Post::i('token_access', 0) != ($user->token_access ? 1 : 0)) {
$to_update['token'] = Post::i('token_access') ? rand_url_id(16) : null;
}
if (Post::i('token_access', 0) != ($user->token_access ? 1 : 0)) {
$to_update['token'] = Post::i('token_access') ? rand_url_id(16) : null;
}
- if (Post::i('skin'
, 0
) != $user->skin) {
- $to_update['skin'] = Post::i('skin'
, 0
);
+ if (Post::i('skin') != $user->skin) {
+ $to_update['skin'] = Post::i('skin');
if ($to_update['skin'] == 0) {
$to_update['skin'] = null;
}
if ($to_update['skin'] == 0) {
$to_update['skin'] = null;
}
@@
-853,8
+858,8
@@
class AdminModule extends PLModule
if ($op == 'list') {
$res = XDB::iterator(
"SELECT a.alias AS homonyme, s.alias AS forlife,
if ($op == 'list') {
$res = XDB::iterator(
"SELECT a.alias AS homonyme, s.alias AS forlife,
- IF(h.homonyme_id = s.id, a.expire, NULL) AS expire,
- IF(h.homonyme_id = s.id, a.type, NULL) AS type, ac.uid
+ IF(h.homonyme_id = s.
u
id, a.expire, NULL) AS expire,
+ IF(h.homonyme_id = s.
u
id, a.type, NULL) AS type, ac.uid
FROM aliases AS a
LEFT JOIN homonyms AS h ON (h.homonyme_id = a.uid)
INNER JOIN aliases AS s ON (s.uid = h.uid AND s.type = 'a_vie')
FROM aliases AS a
LEFT JOIN homonyms AS h ON (h.homonyme_id = a.uid)
INNER JOIN aliases AS s ON (s.uid = h.uid AND s.type = 'a_vie')
@@
-935,7
+940,7
@@
class AdminModule extends PLModule
function handler_validate(&$page, $action = 'list', $id = null)
{
function handler_validate(&$page, $action = 'list', $id = null)
{
- $page->changeTpl('admin/valid
er
.tpl');
+ $page->changeTpl('admin/valid
ation
.tpl');
$page->setTitle('Administration - Valider une demande');
$page->addCssLink('nl.css');
$page->addJsLink('ajax.js');
$page->setTitle('Administration - Valider une demande');
$page->addCssLink('nl.css');
$page->addJsLink('ajax.js');