Skip to content

Commit

Permalink
feature 2060: Remove adviser mode.
Browse files Browse the repository at this point in the history
First commit: only php files.

git-svn-id: http://piwigo.org/svn/trunk@8126 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
patdenice committed Dec 14, 2010
1 parent bf1aa6f commit 731f888
Show file tree
Hide file tree
Showing 28 changed files with 120 additions and 161 deletions.
2 changes: 1 addition & 1 deletion admin/cat_list.php
Expand Up @@ -103,7 +103,7 @@ function save_categories_order($categories)
// | 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'));
Expand Down
2 changes: 1 addition & 1 deletion admin/comments.php
Expand Up @@ -37,7 +37,7 @@
// | actions |
// +-----------------------------------------------------------------------+

if (!empty($_POST) and !is_adviser())
if (!empty($_POST))
{
if (empty($_POST['comments']))
{
Expand Down
13 changes: 5 additions & 8 deletions admin/configuration.php
Expand Up @@ -106,7 +106,7 @@
);

//------------------------------ verification and registration of modifications
if (isset($_POST['submit']) and !is_adviser())
if (isset($_POST['submit']))
{
$int_pattern = '/^\d+$/';

Expand Down Expand Up @@ -323,14 +323,11 @@
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);

Expand Down
2 changes: 1 addition & 1 deletion admin/extend_for_templates.php
Expand Up @@ -117,7 +117,7 @@
// | selected templates |
// +-----------------------------------------------------------------------+

if (isset($_POST['submit']) and !is_adviser())
if (isset($_POST['submit']))
{
$replacements = array();
$i = 0;
Expand Down
6 changes: 3 additions & 3 deletions admin/group_list.php
Expand Up @@ -42,7 +42,7 @@
// | 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 = '
Expand Down Expand Up @@ -85,7 +85,7 @@
// | add a group |
// +-----------------------------------------------------------------------+

if (isset($_POST['submit_add']) and !is_adviser())
if (isset($_POST['submit_add']))
{
if (empty($_POST['groupname']))
{
Expand Down Expand Up @@ -127,7 +127,7 @@
// | 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
Expand Down
117 changes: 57 additions & 60 deletions admin/include/check_integrity.class.php
Expand Up @@ -77,80 +77,77 @@ function check()
}

// 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);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion admin/languages_installed.php
Expand Up @@ -37,7 +37,7 @@
$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']);

Expand Down
2 changes: 1 addition & 1 deletion admin/languages_new.php
Expand Up @@ -56,7 +56,7 @@
// | perform installation |
// +-----------------------------------------------------------------------+

if (isset($_GET['revision']) and !is_adviser())
if (isset($_GET['revision']))
{
if (!is_webmaster())
{
Expand Down
2 changes: 1 addition & 1 deletion admin/maintenance.php
Expand Up @@ -37,7 +37,7 @@
// | actions |
// +-----------------------------------------------------------------------+

$action = (isset($_GET['action']) and !is_adviser()) ? $_GET['action'] : '';
$action = isset($_GET['action']) ? $_GET['action'] : '';

switch ($action)
{
Expand Down
4 changes: 2 additions & 2 deletions admin/menubar.php
Expand Up @@ -64,7 +64,7 @@ function make_consecutive( &$orders, $step=50 )
unset($mb_conf[$id]);
}

if ( isset($_POST['reset']) and !is_adviser())
if ( isset($_POST['reset']))
{
$mb_conf = array();
$query = '
Expand All @@ -85,7 +85,7 @@ function make_consecutive( &$orders, $step=50 )
}


if ( isset($_POST['submit']) and !is_adviser() )
if ( isset($_POST['submit']) )
{
foreach ( $mb_conf as $id => $pos )
{
Expand Down
25 changes: 11 additions & 14 deletions admin/notification_by_mail.php
Expand Up @@ -506,7 +506,7 @@ function do_action_send_mail_notification($action = 'list_to_send', $check_key_l
{
case 'param' :
{
if (isset($_POST['param_submit']) and !is_adviser())
if (isset($_POST['param_submit']))
{
$updated_param_count = 0;
// Update param
Expand Down Expand Up @@ -539,26 +539,23 @@ function do_action_send_mail_notification($action = 'list_to_send', $check_key_l
}
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);
Expand Down
4 changes: 2 additions & 2 deletions admin/permalinks.php
Expand Up @@ -83,7 +83,7 @@ function parse_sort_variables(
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) )
Expand All @@ -92,7 +92,7 @@ function parse_sort_variables(
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.'
Expand Down
8 changes: 2 additions & 6 deletions admin/picture_modify.php
Expand Up @@ -40,7 +40,7 @@
// | synchronize metadata |
// +-----------------------------------------------------------------------+

if (isset($_GET['sync_metadata']) and !is_adviser())
if (isset($_GET['sync_metadata']))
{
$query = '
SELECT path
Expand Down Expand Up @@ -70,7 +70,7 @@
}
}

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'];
Expand Down Expand Up @@ -124,7 +124,6 @@
if (isset($_POST['associate'])
and isset($_POST['cat_dissociated'])
and count($_POST['cat_dissociated']) > 0
and !is_adviser()
)
{
associate_images_to_categories(
Expand All @@ -136,7 +135,6 @@
if (isset($_POST['dissociate'])
and isset($_POST['cat_associated'])
and count($_POST['cat_associated']) > 0
and !is_adviser()
)
{
$query = '
Expand All @@ -152,7 +150,6 @@
if (isset($_POST['elect'])
and isset($_POST['cat_dismissed'])
and count($_POST['cat_dismissed']) > 0
and !is_adviser()
)
{
$datas = array();
Expand All @@ -170,7 +167,6 @@
if (isset($_POST['dismiss'])
and isset($_POST['cat_elected'])
and count($_POST['cat_elected']) > 0
and !is_adviser()
)
{
set_random_representant($_POST['cat_elected']);
Expand Down
2 changes: 1 addition & 1 deletion admin/plugins_list.php
Expand Up @@ -36,7 +36,7 @@
$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();

Expand Down
2 changes: 1 addition & 1 deletion admin/plugins_update.php
Expand Up @@ -35,7 +35,7 @@
$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())
{
Expand Down

0 comments on commit 731f888

Please sign in to comment.