aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorgweltas <gweltas@piwigo.org>2004-01-15 17:06:45 +0000
committergweltas <gweltas@piwigo.org>2004-01-15 17:06:45 +0000
commit384ec739f6c11ab82f9a57e9398e954206c7a7ca (patch)
tree0155d90946660816650d5f5f3031968cc8da6caa /admin
parent855398f63e4215ed16413a89f781dd2f6cffa231 (diff)
Correction of php warnings
git-svn-id: http://piwigo.org/svn/branches/release-1_3@280 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin')
-rw-r--r--admin/stats.php26
-rw-r--r--admin/thumbnail.php5
-rw-r--r--admin/user_list.php3
-rw-r--r--admin/user_perm.php2
4 files changed, 23 insertions, 13 deletions
diff --git a/admin/stats.php b/admin/stats.php
index 345d4c669..61f6e236d 100644
--- a/admin/stats.php
+++ b/admin/stats.php
@@ -42,13 +42,15 @@ $tpl = array( 'stats_last_days','date','login',
templatize_array( $tpl, 'lang', $sub );
$vtp->setGlobalVar( $sub, 'user_template', $user['template'] );
//--------------------------------------------------- number of days to display
-if ( isset( $_GET['last_days'] ) ) define( MAX_DAYS, $_GET['last_days'] );
-else define( MAX_DAYS, 0 );
+if ( isset( $_GET['last_days'] ) ) define( 'MAX_DAYS', $_GET['last_days'] );
+else define( 'MAX_DAYS', 0 );
foreach ( $conf['last_days'] as $option ) {
$vtp->addSession( $sub, 'last_day_option' );
$vtp->setVar( $sub, 'last_day_option.option', $option );
- $url = './admin.php?page=stats&amp;expand='.$_GET['expand'];
+ $url = './admin.php?page=stats';
+ if (isset($_GET['expand']))
+ $url .='&amp;expand='.$_GET['expand'];
$url.= '&amp;last_days='.($option - 1);
$vtp->setVar( $sub, 'last_day_option.link', add_session_id( $url ) );
if ( $option == MAX_DAYS + 1 )
@@ -59,12 +61,18 @@ foreach ( $conf['last_days'] as $option ) {
}
//---------------------------------------------------------------- log history
// empty link
-$url = './admin.php?page=stats&amp;last_days='.$_GET['last_days'];
-$url.= '&amp;expand='.$_GET['expand'];
+$url = './admin.php?page=stats';
+if (isset($_GET['last_days']))
+ $url .='&amp;last_days='.$_GET['last_days'];
+// expand array management
+$expand_days = array();
+if (isset($_GET['expand']))
+{
+ $url.= '&amp;expand='.$_GET['expand'];
+ $expand_days = explode( ',', $_GET['expand'] );
+}
$url.= '&amp;act=empty';
$vtp->setVar( $sub, 'emply_url', add_session_id( $url ) );
-// expand array management
-$expand_days = explode( ',', $_GET['expand'] );
$page['expand_days'] = array();
foreach ( $expand_days as $expand_day ) {
if ( is_numeric( $expand_day ) )
@@ -99,7 +107,9 @@ for ( $i = 0; $i <= MAX_DAYS; $i++ )
$vtp->setVar( $sub, 'day.open_or_close', $lang['open'] );
array_push( $local_expand, $i );
}
- $url = './admin.php?page=stats&amp;last_days='.$_GET['last_days'];
+ $url = './admin.php?page=stats';
+ if (isset($_GET['last_days']))
+ $url.= '&amp;last_days='.$_GET['last_days'];
$url.= '&amp;expand='.implode( ',', $local_expand );
$vtp->setVar( $sub, 'day.url', add_session_id( $url ) );
// date displayed like this (in English ) :
diff --git a/admin/thumbnail.php b/admin/thumbnail.php
index 171049a1c..e3ab3e9a5 100644
--- a/admin/thumbnail.php
+++ b/admin/thumbnail.php
@@ -253,9 +253,8 @@ function get_displayed_dirs( $dir, $indent )
}
$vtp->closeSession( $sub, 'dir' );
// recursive call
- $dirs.= get_displayed_dirs( $dir.'/'.$sub_dir,
- $indent+30 );
-
+ get_displayed_dirs( $dir.'/'.$sub_dir,
+ $indent+30 );
}
}
//----------------------------------------------------- template initialization
diff --git a/admin/user_list.php b/admin/user_list.php
index 270ea2f4b..2fbf3ccc4 100644
--- a/admin/user_list.php
+++ b/admin/user_list.php
@@ -109,7 +109,8 @@ else
$vtp->addSession( $sub, 'add_user' );
$action = './admin.php?'.$_SERVER['QUERY_STRING'];
$vtp->setVar( $sub, 'add_user.form_action', $action );
- $vtp->setVar( $sub, 'add_user.f_username', $_POST['username'] );
+ if (isset( $_POST['username']))
+ $vtp->setVar( $sub, 'add_user.f_username', $_POST['username'] );
$vtp->closeSession( $sub, 'add_user' );
$vtp->addSession( $sub, 'users' );
diff --git a/admin/user_perm.php b/admin/user_perm.php
index ff3b83dce..c572c585d 100644
--- a/admin/user_perm.php
+++ b/admin/user_perm.php
@@ -59,7 +59,7 @@ if ( isset( $_POST['submit'] ) )
$vtp->closeSession( $sub, 'confirmation' );
}
//---------------------------------------------------------------- form display
-$restrictions = get_restrictions( $_GET['user_id'], $page['user_status'],
+$restrictions = get_user_restrictions( $_GET['user_id'], $page['user_status'],
false, false );
$action = './admin.php?page=user_perm&amp;user_id='.$_GET['user_id'];
$vtp->setVar( $sub, 'action', add_session_id( $action ) );