aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2010-12-14 13:47:24 +0000
committerpatdenice <patdenice@piwigo.org>2010-12-14 13:47:24 +0000
commit731f8888a45d4b48e94bff05187e0e2ca40d4ef5 (patch)
tree1fc44a3a59beafe636b74127498d0ed62decdc76 /admin
parentbf1aa6fcf1f6d9038a0723e4f0213e416ec5ee62 (diff)
feature 2060: Remove adviser mode.
First commit: only php files. git-svn-id: http://piwigo.org/svn/trunk@8126 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin')
-rw-r--r--admin/cat_list.php2
-rw-r--r--admin/comments.php2
-rw-r--r--admin/configuration.php13
-rw-r--r--admin/extend_for_templates.php2
-rw-r--r--admin/group_list.php6
-rw-r--r--admin/include/check_integrity.class.php117
-rw-r--r--admin/languages_installed.php2
-rw-r--r--admin/languages_new.php2
-rw-r--r--admin/maintenance.php2
-rw-r--r--admin/menubar.php4
-rw-r--r--admin/notification_by_mail.php25
-rw-r--r--admin/permalinks.php4
-rw-r--r--admin/picture_modify.php8
-rw-r--r--admin/plugins_list.php2
-rw-r--r--admin/plugins_update.php2
-rw-r--r--admin/profile.php5
-rw-r--r--admin/rating.php2
-rw-r--r--admin/site_manager.php5
-rw-r--r--admin/site_update.php2
-rw-r--r--admin/tags.php6
-rw-r--r--admin/themes_installed.php2
21 files changed, 99 insertions, 116 deletions
diff --git a/admin/cat_list.php b/admin/cat_list.php
index dd79287bd..98dfecc03 100644
--- a/admin/cat_list.php
+++ b/admin/cat_list.php
@@ -103,7 +103,7 @@ $navigation.= '</a>';
// | virtual categories management |
// +-----------------------------------------------------------------------+
// request to delete a virtual category / not for an adviser
-if (isset($_GET['delete']) and is_numeric($_GET['delete']) and !is_adviser())
+if (isset($_GET['delete']) and is_numeric($_GET['delete']))
{
delete_categories(array($_GET['delete']));
array_push($page['infos'], l10n('Virtual album deleted'));
diff --git a/admin/comments.php b/admin/comments.php
index 4bb4490ac..7bafef70a 100644
--- a/admin/comments.php
+++ b/admin/comments.php
@@ -37,7 +37,7 @@ check_status(ACCESS_ADMINISTRATOR);
// | actions |
// +-----------------------------------------------------------------------+
-if (!empty($_POST) and !is_adviser())
+if (!empty($_POST))
{
if (empty($_POST['comments']))
{
diff --git a/admin/configuration.php b/admin/configuration.php
index 0f088cc3e..36a2901ae 100644
--- a/admin/configuration.php
+++ b/admin/configuration.php
@@ -106,7 +106,7 @@ $display_info_checkboxes = array(
);
//------------------------------ verification and registration of modifications
-if (isset($_POST['submit']) and !is_adviser())
+if (isset($_POST['submit']))
{
$int_pattern = '/^\d+$/';
@@ -323,14 +323,11 @@ switch ($page['section'])
include_once(PHPWG_ROOT_PATH.'profile.php');
$errors = array();
- if ( !is_adviser() )
+ if (save_profile_from_post($edit_user, $errors))
{
- if (save_profile_from_post($edit_user, $errors))
- {
- // Reload user
- $edit_user = build_user($conf['guest_id'], false);
- array_push($page['infos'], l10n('Information data registered in database'));
- }
+ // Reload user
+ $edit_user = build_user($conf['guest_id'], false);
+ array_push($page['infos'], l10n('Information data registered in database'));
}
$page['errors'] = array_merge($page['errors'], $errors);
diff --git a/admin/extend_for_templates.php b/admin/extend_for_templates.php
index a6cd56d92..a36b60b03 100644
--- a/admin/extend_for_templates.php
+++ b/admin/extend_for_templates.php
@@ -117,7 +117,7 @@ $available_templates = array_merge(
// | selected templates |
// +-----------------------------------------------------------------------+
-if (isset($_POST['submit']) and !is_adviser())
+if (isset($_POST['submit']))
{
$replacements = array();
$i = 0;
diff --git a/admin/group_list.php b/admin/group_list.php
index d79b3aa9a..a7a8f8a83 100644
--- a/admin/group_list.php
+++ b/admin/group_list.php
@@ -42,7 +42,7 @@ if (!empty($_POST) or isset($_GET['delete']) or isset($_GET['toggle_is_default']
// | delete a group |
// +-----------------------------------------------------------------------+
-if (isset($_GET['delete']) and is_numeric($_GET['delete']) and !is_adviser())
+if (isset($_GET['delete']) and is_numeric($_GET['delete']))
{
// destruction of the access linked to the group
$query = '
@@ -85,7 +85,7 @@ DELETE
// | add a group |
// +-----------------------------------------------------------------------+
-if (isset($_POST['submit_add']) and !is_adviser())
+if (isset($_POST['submit_add']))
{
if (empty($_POST['groupname']))
{
@@ -127,7 +127,7 @@ INSERT INTO '.GROUPS_TABLE.'
// | toggle is default group property |
// +-----------------------------------------------------------------------+
-if (isset($_GET['toggle_is_default']) and is_numeric($_GET['toggle_is_default']) and !is_adviser())
+if (isset($_GET['toggle_is_default']) and is_numeric($_GET['toggle_is_default']))
{
$query = '
SELECT name, is_default
diff --git a/admin/include/check_integrity.class.php b/admin/include/check_integrity.class.php
index 70c8d73ac..da86761c7 100644
--- a/admin/include/check_integrity.class.php
+++ b/admin/include/check_integrity.class.php
@@ -77,80 +77,77 @@ class check_integrity
}
// Treatments
- if (!is_adviser())
+ if (isset($_POST['c13y_submit_correction']) and isset($_POST['c13y_selection']))
{
- if (isset($_POST['c13y_submit_correction']) and isset($_POST['c13y_selection']))
- {
- $corrected_count = 0;
- $not_corrected_count = 0;
+ $corrected_count = 0;
+ $not_corrected_count = 0;
- foreach ($this->retrieve_list as $i => $c13y)
+ foreach ($this->retrieve_list as $i => $c13y)
+ {
+ if (!empty($c13y['correction_fct']) and
+ $c13y['is_callable'] and
+ in_array($c13y['id'], $_POST['c13y_selection']))
{
- if (!empty($c13y['correction_fct']) and
- $c13y['is_callable'] and
- in_array($c13y['id'], $_POST['c13y_selection']))
+ if (is_array($c13y['correction_fct_args']))
{
- if (is_array($c13y['correction_fct_args']))
- {
- $args = $c13y['correction_fct_args'];
- }
- else
- if (!is_null($c13y['correction_fct_args']))
- {
- $args = array($c13y['correction_fct_args']);
- }
- else
- {
- $args = array();
- }
- $this->retrieve_list[$i]['corrected'] = call_user_func_array($c13y['correction_fct'], $args);
+ $args = $c13y['correction_fct_args'];
+ }
+ else
+ if (!is_null($c13y['correction_fct_args']))
+ {
+ $args = array($c13y['correction_fct_args']);
+ }
+ else
+ {
+ $args = array();
+ }
+ $this->retrieve_list[$i]['corrected'] = call_user_func_array($c13y['correction_fct'], $args);
- if ($this->retrieve_list[$i]['corrected'])
- {
- $corrected_count += 1;
- }
- else
- {
- $not_corrected_count += 1;
- }
+ if ($this->retrieve_list[$i]['corrected'])
+ {
+ $corrected_count += 1;
+ }
+ else
+ {
+ $not_corrected_count += 1;
}
}
+ }
- if ($corrected_count > 0)
- {
- $page['infos'][] =
- l10n_dec('%d anomaly has been corrected.', '%d anomalies have been detected corrected.',
- $corrected_count);
- }
- if ($not_corrected_count > 0)
- {
- $page['errors'][] =
- l10n_dec('%d anomaly has not been corrected.', '%d anomalies have not been corrected.',
- $not_corrected_count);
- }
+ if ($corrected_count > 0)
+ {
+ $page['infos'][] =
+ l10n_dec('%d anomaly has been corrected.', '%d anomalies have been detected corrected.',
+ $corrected_count);
}
- else
+ if ($not_corrected_count > 0)
{
- if (isset($_POST['c13y_submit_ignore']) and isset($_POST['c13y_selection']))
- {
- $ignored_count = 0;
+ $page['errors'][] =
+ l10n_dec('%d anomaly has not been corrected.', '%d anomalies have not been corrected.',
+ $not_corrected_count);
+ }
+ }
+ else
+ {
+ if (isset($_POST['c13y_submit_ignore']) and isset($_POST['c13y_selection']))
+ {
+ $ignored_count = 0;
- foreach ($this->retrieve_list as $i => $c13y)
+ foreach ($this->retrieve_list as $i => $c13y)
+ {
+ if (in_array($c13y['id'], $_POST['c13y_selection']))
{
- if (in_array($c13y['id'], $_POST['c13y_selection']))
- {
- $this->build_ignore_list[] = $c13y['id'];
- $this->retrieve_list[$i]['ignored'] = true;
- $ignored_count += 1;
- }
+ $this->build_ignore_list[] = $c13y['id'];
+ $this->retrieve_list[$i]['ignored'] = true;
+ $ignored_count += 1;
}
+ }
- if ($ignored_count > 0)
- {
- $page['infos'][] =
- l10n_dec('%d anomaly has been ignored.', '%d anomalies have been ignored.',
- $ignored_count);
- }
+ if ($ignored_count > 0)
+ {
+ $page['infos'][] =
+ l10n_dec('%d anomaly has been ignored.', '%d anomalies have been ignored.',
+ $ignored_count);
}
}
}
diff --git a/admin/languages_installed.php b/admin/languages_installed.php
index 98c085ed3..bfd16fd67 100644
--- a/admin/languages_installed.php
+++ b/admin/languages_installed.php
@@ -37,7 +37,7 @@ $languages->get_db_languages();
$languages->set_tabsheet($page['page']);
//--------------------------------------------------perform requested actions
-if (isset($_GET['action']) and isset($_GET['language']) and !is_adviser())
+if (isset($_GET['action']) and isset($_GET['language']))
{
$page['errors'] = $languages->perform_action($_GET['action'], $_GET['language']);
diff --git a/admin/languages_new.php b/admin/languages_new.php
index f80ee33ee..6e673028f 100644
--- a/admin/languages_new.php
+++ b/admin/languages_new.php
@@ -56,7 +56,7 @@ if (!is_writable($languages_dir))
// | perform installation |
// +-----------------------------------------------------------------------+
-if (isset($_GET['revision']) and !is_adviser())
+if (isset($_GET['revision']))
{
if (!is_webmaster())
{
diff --git a/admin/maintenance.php b/admin/maintenance.php
index 06b80862f..09f90ce68 100644
--- a/admin/maintenance.php
+++ b/admin/maintenance.php
@@ -37,7 +37,7 @@ check_status(ACCESS_ADMINISTRATOR);
// | actions |
// +-----------------------------------------------------------------------+
-$action = (isset($_GET['action']) and !is_adviser()) ? $_GET['action'] : '';
+$action = isset($_GET['action']) ? $_GET['action'] : '';
switch ($action)
{
diff --git a/admin/menubar.php b/admin/menubar.php
index 1449b4510..65f2bfea3 100644
--- a/admin/menubar.php
+++ b/admin/menubar.php
@@ -64,7 +64,7 @@ foreach ($mb_conf as $id => $pos)
unset($mb_conf[$id]);
}
-if ( isset($_POST['reset']) and !is_adviser())
+if ( isset($_POST['reset']))
{
$mb_conf = array();
$query = '
@@ -85,7 +85,7 @@ foreach ($reg_blocks as $id => $block)
}
-if ( isset($_POST['submit']) and !is_adviser() )
+if ( isset($_POST['submit']) )
{
foreach ( $mb_conf as $id => $pos )
{
diff --git a/admin/notification_by_mail.php b/admin/notification_by_mail.php
index 602c67394..4c7007d91 100644
--- a/admin/notification_by_mail.php
+++ b/admin/notification_by_mail.php
@@ -506,7 +506,7 @@ switch ($page['mode'])
{
case 'param' :
{
- if (isset($_POST['param_submit']) and !is_adviser())
+ if (isset($_POST['param_submit']))
{
$updated_param_count = 0;
// Update param
@@ -539,26 +539,23 @@ where
}
case 'subscribe' :
{
- if (!is_adviser())
+ if (isset($_POST['falsify']) and isset($_POST['cat_true']))
{
- if (isset($_POST['falsify']) and isset($_POST['cat_true']))
- {
- $check_key_treated = unsubscribe_notification_by_mail(true, $_POST['cat_true']);
- do_timeout_treatment('cat_true', $check_key_treated);
- }
- else
- if (isset($_POST['trueify']) and isset($_POST['cat_false']))
- {
- $check_key_treated = subscribe_notification_by_mail(true, $_POST['cat_false']);
- do_timeout_treatment('cat_false', $check_key_treated);
- }
+ $check_key_treated = unsubscribe_notification_by_mail(true, $_POST['cat_true']);
+ do_timeout_treatment('cat_true', $check_key_treated);
+ }
+ else
+ if (isset($_POST['trueify']) and isset($_POST['cat_false']))
+ {
+ $check_key_treated = subscribe_notification_by_mail(true, $_POST['cat_false']);
+ do_timeout_treatment('cat_false', $check_key_treated);
}
break;
}
case 'send' :
{
- if (isset($_POST['send_submit']) and isset($_POST['send_selection']) and isset($_POST['send_customize_mail_content']) and !is_adviser())
+ if (isset($_POST['send_submit']) and isset($_POST['send_selection']) and isset($_POST['send_customize_mail_content']))
{
$check_key_treated = do_action_send_mail_notification('send', $_POST['send_selection'], stripslashes($_POST['send_customize_mail_content']));
do_timeout_treatment('send_selection', $check_key_treated);
diff --git a/admin/permalinks.php b/admin/permalinks.php
index 7ec83efc2..a3732e9fe 100644
--- a/admin/permalinks.php
+++ b/admin/permalinks.php
@@ -83,7 +83,7 @@ if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
include_once(PHPWG_ROOT_PATH.'admin/include/functions_permalinks.php');
$selected_cat = array();
-if ( isset($_POST['set_permalink']) and $_POST['cat_id']>0 and !is_adviser() )
+if ( isset($_POST['set_permalink']) and $_POST['cat_id']>0 )
{
$permalink = $_POST['permalink'];
if ( empty($permalink) )
@@ -92,7 +92,7 @@ if ( isset($_POST['set_permalink']) and $_POST['cat_id']>0 and !is_adviser() )
set_cat_permalink($_POST['cat_id'], $permalink, isset($_POST['save']) );
$selected_cat = array( $_POST['cat_id'] );
}
-elseif ( isset($_GET['delete_permanent']) and !is_adviser() )
+elseif ( isset($_GET['delete_permanent']) )
{
$query = '
DELETE FROM '.OLD_PERMALINKS_TABLE.'
diff --git a/admin/picture_modify.php b/admin/picture_modify.php
index 4d15a9206..db776c6d3 100644
--- a/admin/picture_modify.php
+++ b/admin/picture_modify.php
@@ -40,7 +40,7 @@ check_input_parameter('cat_id', $_GET, false, PATTERN_ID);
// | synchronize metadata |
// +-----------------------------------------------------------------------+
-if (isset($_GET['sync_metadata']) and !is_adviser())
+if (isset($_GET['sync_metadata']))
{
$query = '
SELECT path
@@ -70,7 +70,7 @@ if (isset($_POST['date_creation_action'])
}
}
-if (isset($_POST['submit']) and count($page['errors']) == 0 and !is_adviser())
+if (isset($_POST['submit']) and count($page['errors']) == 0)
{
$data = array();
$data{'id'} = $_GET['image_id'];
@@ -124,7 +124,6 @@ if (isset($_POST['submit']) and count($page['errors']) == 0 and !is_adviser())
if (isset($_POST['associate'])
and isset($_POST['cat_dissociated'])
and count($_POST['cat_dissociated']) > 0
- and !is_adviser()
)
{
associate_images_to_categories(
@@ -136,7 +135,6 @@ if (isset($_POST['associate'])
if (isset($_POST['dissociate'])
and isset($_POST['cat_associated'])
and count($_POST['cat_associated']) > 0
- and !is_adviser()
)
{
$query = '
@@ -152,7 +150,6 @@ DELETE FROM '.IMAGE_CATEGORY_TABLE.'
if (isset($_POST['elect'])
and isset($_POST['cat_dismissed'])
and count($_POST['cat_dismissed']) > 0
- and !is_adviser()
)
{
$datas = array();
@@ -170,7 +167,6 @@ if (isset($_POST['elect'])
if (isset($_POST['dismiss'])
and isset($_POST['cat_elected'])
and count($_POST['cat_elected']) > 0
- and !is_adviser()
)
{
set_random_representant($_POST['cat_elected']);
diff --git a/admin/plugins_list.php b/admin/plugins_list.php
index 0e0076a56..66a3a9cd6 100644
--- a/admin/plugins_list.php
+++ b/admin/plugins_list.php
@@ -36,7 +36,7 @@ $action_url = $base_url.'&amp;plugin='.'%s'.'&amp;pwg_token='.get_pwg_token();
$plugins = new plugins();
//--------------------------------------------------perform requested actions
-if (isset($_GET['action']) and isset($_GET['plugin']) and !is_adviser())
+if (isset($_GET['action']) and isset($_GET['plugin']))
{
check_pwg_token();
diff --git a/admin/plugins_update.php b/admin/plugins_update.php
index 332c97cb4..f3e0386ff 100644
--- a/admin/plugins_update.php
+++ b/admin/plugins_update.php
@@ -35,7 +35,7 @@ $base_url = get_root_url().'admin.php?page='.$page['page'];
$plugins = new plugins();
//-----------------------------------------------------------automatic upgrade
-if (isset($_GET['plugin']) and isset($_GET['revision']) and !is_adviser())
+if (isset($_GET['plugin']) and isset($_GET['revision']))
{
if (!is_webmaster())
{
diff --git a/admin/profile.php b/admin/profile.php
index ebb372518..7b0ad707c 100644
--- a/admin/profile.php
+++ b/admin/profile.php
@@ -33,10 +33,7 @@ if (!empty($_POST))
include_once(PHPWG_ROOT_PATH.'profile.php');
$errors = array();
-if ( !is_adviser() )
-{
- save_profile_from_post($edit_user, $errors);
-}
+save_profile_from_post($edit_user, $errors);
load_profile_in_template(
get_root_url().'admin.php?page=profile&amp;user_id='.$edit_user['id'],
diff --git a/admin/rating.php b/admin/rating.php
index 6fa1c585c..aa19a8953 100644
--- a/admin/rating.php
+++ b/admin/rating.php
@@ -70,7 +70,7 @@ if (isset($_GET['users']))
}
}
-if (isset($_GET['del']) and !is_adviser())
+if (isset($_GET['del']))
{
$del_params = urldecode( $_GET['del'] );
parse_str($del_params, $vars);
diff --git a/admin/site_manager.php b/admin/site_manager.php
index b125f6181..1b625ec46 100644
--- a/admin/site_manager.php
+++ b/admin/site_manager.php
@@ -83,8 +83,7 @@ $template->set_filenames(array('site_manager'=>'site_manager.tpl'));
// +-----------------------------------------------------------------------+
// | new site creation form |
// +-----------------------------------------------------------------------+
-if (isset($_POST['submit']) and !empty($_POST['galleries_url'])
- and !is_adviser() )
+if (isset($_POST['submit']) and !empty($_POST['galleries_url']))
{
$is_remote = url_is_remote( $_POST['galleries_url'] );
$url = preg_replace('/[\/]*$/', '', $_POST['galleries_url']);
@@ -167,7 +166,7 @@ if (isset($_GET['site']) and is_numeric($_GET['site']))
{
$page['site'] = $_GET['site'];
}
-if (isset($_GET['action']) and isset($page['site']) and !is_adviser())
+if (isset($_GET['action']) and isset($page['site']))
{
$query = '
SELECT galleries_url
diff --git a/admin/site_update.php b/admin/site_update.php
index 17e5dd205..6c2e74c60 100644
--- a/admin/site_update.php
+++ b/admin/site_update.php
@@ -108,7 +108,7 @@ if (isset($_POST['submit']))
}
// shall we simulate only
- if ((isset($_POST['simulate']) and $_POST['simulate'] == 1) or is_adviser())
+ if (isset($_POST['simulate']) and $_POST['simulate'] == 1)
{
$simulate = true;
}
diff --git a/admin/tags.php b/admin/tags.php
index 7273921f6..4930b3fd1 100644
--- a/admin/tags.php
+++ b/admin/tags.php
@@ -38,7 +38,7 @@ if (!empty($_POST))
// | edit tags |
// +-----------------------------------------------------------------------+
-if (isset($_POST['submit']) and !is_adviser())
+if (isset($_POST['submit']))
{
$query = '
SELECT name
@@ -104,7 +104,7 @@ SELECT id, name
// | delete tags |
// +-----------------------------------------------------------------------+
-if (isset($_POST['delete']) and isset($_POST['tags']) and !is_adviser())
+if (isset($_POST['delete']) and isset($_POST['tags']))
{
$query = '
SELECT name
@@ -141,7 +141,7 @@ DELETE
// | add a tag |
// +-----------------------------------------------------------------------+
-if (isset($_POST['add']) and !empty($_POST['add_tag']) and !is_adviser())
+if (isset($_POST['add']) and !empty($_POST['add_tag']))
{
$tag_name = $_POST['add_tag'];
diff --git a/admin/themes_installed.php b/admin/themes_installed.php
index 33ebf03e5..3793e4897 100644
--- a/admin/themes_installed.php
+++ b/admin/themes_installed.php
@@ -36,7 +36,7 @@ $themes = new themes();
// | perform actions |
// +-----------------------------------------------------------------------+
-if (isset($_GET['action']) and isset($_GET['theme']) and !is_adviser())
+if (isset($_GET['action']) and isset($_GET['theme']))
{
$page['errors'] = $themes->perform_action($_GET['action'], $_GET['theme']);