feature 2060: Remove adviser mode.
First commit: only php files. git-svn-id: http://piwigo.org/svn/trunk@8126 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
bf1aa6fcf1
commit
731f8888a4
28 changed files with 123 additions and 164 deletions
|
@ -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'));
|
||||
|
|
|
@ -37,7 +37,7 @@ check_status(ACCESS_ADMINISTRATOR);
|
|||
// | actions |
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
if (!empty($_POST) and !is_adviser())
|
||||
if (!empty($_POST))
|
||||
{
|
||||
if (empty($_POST['comments']))
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
foreach ($this->retrieve_list as $i => $c13y)
|
||||
{
|
||||
$corrected_count = 0;
|
||||
$not_corrected_count = 0;
|
||||
if (!empty($c13y['correction_fct']) and
|
||||
$c13y['is_callable'] and
|
||||
in_array($c13y['id'], $_POST['c13y_selection']))
|
||||
{
|
||||
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);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isset($_POST['c13y_submit_ignore']) and isset($_POST['c13y_selection']))
|
||||
{
|
||||
$ignored_count = 0;
|
||||
|
||||
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 (in_array($c13y['id'], $_POST['c13y_selection']))
|
||||
{
|
||||
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);
|
||||
|
||||
if ($this->retrieve_list[$i]['corrected'])
|
||||
{
|
||||
$corrected_count += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$not_corrected_count += 1;
|
||||
}
|
||||
$this->build_ignore_list[] = $c13y['id'];
|
||||
$this->retrieve_list[$i]['ignored'] = true;
|
||||
$ignored_count += 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($corrected_count > 0)
|
||||
if ($ignored_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);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isset($_POST['c13y_submit_ignore']) and isset($_POST['c13y_selection']))
|
||||
{
|
||||
$ignored_count = 0;
|
||||
|
||||
foreach ($this->retrieve_list as $i => $c13y)
|
||||
{
|
||||
if (in_array($c13y['id'], $_POST['c13y_selection']))
|
||||
{
|
||||
$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);
|
||||
}
|
||||
l10n_dec('%d anomaly has been ignored.', '%d anomalies have been ignored.',
|
||||
$ignored_count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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']);
|
||||
|
||||
|
|
|
@ -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())
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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.'
|
||||
|
|
|
@ -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']);
|
||||
|
|
|
@ -36,7 +36,7 @@ $action_url = $base_url.'&plugin='.'%s'.'&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();
|
||||
|
||||
|
|
|
@ -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())
|
||||
{
|
||||
|
|
|
@ -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&user_id='.$edit_user['id'],
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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'];
|
||||
|
||||
|
|
|
@ -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']);
|
||||
|
||||
|
|
|
@ -207,11 +207,6 @@ if ($conf['check_upgrade_feed'])
|
|||
}
|
||||
}
|
||||
|
||||
if (is_adviser())
|
||||
{
|
||||
$header_msgs[] = l10n('Adviser mode enabled');
|
||||
}
|
||||
|
||||
if (count($header_msgs) > 0)
|
||||
{
|
||||
$template->assign('header_msgs', $header_msgs);
|
||||
|
|
|
@ -1319,14 +1319,12 @@ function check_status($access_type, $user_status = '')
|
|||
}
|
||||
|
||||
/*
|
||||
* Return if current user is an adviser
|
||||
* @return bool
|
||||
* Adviser status is depreciated from piwigo 2.2
|
||||
* @return false
|
||||
*/
|
||||
function is_adviser()
|
||||
{
|
||||
global $user;
|
||||
|
||||
return ($user['adviser'] == 'true');
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1384,14 +1382,7 @@ function get_email_address_as_display_text($email_address)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (defined('IN_ADMIN') and is_adviser())
|
||||
{
|
||||
return 'adviser.mode@'.$_SERVER['SERVER_NAME'];
|
||||
}
|
||||
else
|
||||
{
|
||||
return $email_address;
|
||||
}
|
||||
return $email_address;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -353,8 +353,7 @@ class Template {
|
|||
}
|
||||
|
||||
$this->smarty->assign( 'ROOT_URL', get_root_url() );
|
||||
$this->smarty->assign( 'TAG_INPUT_ENABLED',
|
||||
((is_adviser()) ? 'disabled="disabled" onclick="return false;"' : ''));
|
||||
$this->smarty->assign( 'TAG_INPUT_ENABLED', '');
|
||||
|
||||
$save_compile_id = $this->smarty->compile_id;
|
||||
$this->load_external_filters($handle);
|
||||
|
|
|
@ -892,7 +892,7 @@ SELECT * FROM '.IMAGES_TABLE.'
|
|||
|
||||
function ws_images_setPrivacyLevel($params, &$service)
|
||||
{
|
||||
if (!is_admin() || is_adviser() )
|
||||
if (!is_admin())
|
||||
{
|
||||
return new PwgError(401, 'Access denied');
|
||||
}
|
||||
|
@ -935,7 +935,7 @@ function ws_images_add_chunk($params, &$service)
|
|||
// type {thumb, file, high}
|
||||
// position
|
||||
|
||||
if (!is_admin() || is_adviser() )
|
||||
if (!is_admin())
|
||||
{
|
||||
return new PwgError(401, 'Access denied');
|
||||
}
|
||||
|
@ -1139,7 +1139,7 @@ function ws_images_addFile($params, &$service)
|
|||
// sum
|
||||
|
||||
global $conf;
|
||||
if (!is_admin() || is_adviser() )
|
||||
if (!is_admin())
|
||||
{
|
||||
return new PwgError(401, 'Access denied');
|
||||
}
|
||||
|
@ -1208,7 +1208,7 @@ SELECT
|
|||
function ws_images_add($params, &$service)
|
||||
{
|
||||
global $conf;
|
||||
if (!is_admin() || is_adviser() )
|
||||
if (!is_admin())
|
||||
{
|
||||
return new PwgError(401, 'Access denied');
|
||||
}
|
||||
|
@ -1584,7 +1584,7 @@ LIMIT '.(int)$params['per_page'].' OFFSET '.(int)($params['per_page']*$params['p
|
|||
|
||||
function ws_categories_add($params, &$service)
|
||||
{
|
||||
if (!is_admin() or is_adviser())
|
||||
if (!is_admin())
|
||||
{
|
||||
return new PwgError(401, 'Access denied');
|
||||
}
|
||||
|
@ -1608,7 +1608,7 @@ function ws_categories_add($params, &$service)
|
|||
|
||||
function ws_tags_add($params, &$service)
|
||||
{
|
||||
if (!is_admin() or is_adviser())
|
||||
if (!is_admin())
|
||||
{
|
||||
return new PwgError(401, 'Access denied');
|
||||
}
|
||||
|
@ -1629,7 +1629,7 @@ function ws_images_exist($params, &$service)
|
|||
{
|
||||
global $conf;
|
||||
|
||||
if (!is_admin() or is_adviser())
|
||||
if (!is_admin())
|
||||
{
|
||||
return new PwgError(401, 'Access denied');
|
||||
}
|
||||
|
@ -1705,7 +1705,7 @@ SELECT
|
|||
|
||||
function ws_images_checkFiles($params, &$service)
|
||||
{
|
||||
if (!is_admin() or is_adviser())
|
||||
if (!is_admin())
|
||||
{
|
||||
return new PwgError(401, 'Access denied');
|
||||
}
|
||||
|
@ -1790,7 +1790,7 @@ function file_path_for_type($file_path, $type='thumb')
|
|||
function ws_images_setInfo($params, &$service)
|
||||
{
|
||||
global $conf;
|
||||
if (!is_admin() || is_adviser() )
|
||||
if (!is_admin())
|
||||
{
|
||||
return new PwgError(401, 'Access denied');
|
||||
}
|
||||
|
@ -2073,7 +2073,7 @@ SELECT
|
|||
function ws_categories_setInfo($params, &$service)
|
||||
{
|
||||
global $conf;
|
||||
if (!is_admin() || is_adviser() )
|
||||
if (!is_admin())
|
||||
{
|
||||
return new PwgError(401, 'Access denied');
|
||||
}
|
||||
|
@ -2147,7 +2147,7 @@ function ws_images_checkUpload($params, &$service)
|
|||
{
|
||||
global $conf;
|
||||
|
||||
if (!is_admin() or is_adviser())
|
||||
if (!is_admin())
|
||||
{
|
||||
return new PwgError(401, 'Access denied');
|
||||
}
|
||||
|
|
|
@ -276,7 +276,7 @@ DELETE FROM '.FAVORITES_TABLE.'
|
|||
}
|
||||
case 'set_as_representative' :
|
||||
{
|
||||
if (is_admin() and !is_adviser() and isset($page['category']))
|
||||
if (is_admin() and isset($page['category']))
|
||||
{
|
||||
$query = '
|
||||
UPDATE '.CATEGORIES_TABLE.'
|
||||
|
|
|
@ -164,7 +164,7 @@ switch ($page['tab'])
|
|||
|
||||
case 'tpl':
|
||||
// New file form creation
|
||||
if ($newfile_page and !is_adviser())
|
||||
if ($newfile_page)
|
||||
{
|
||||
$filename = isset($_POST['tpl_name']) ? $_POST['tpl_name'] : '';
|
||||
$selected['model'] = isset($_POST['tpl_model']) ? $_POST['tpl_model'] : '0';
|
||||
|
@ -280,7 +280,7 @@ switch ($page['tab'])
|
|||
// +-----------------------------------------------------------------------+
|
||||
// | Load backup file
|
||||
// +-----------------------------------------------------------------------+
|
||||
if (isset($_POST['restore']) and !is_adviser())
|
||||
if (isset($_POST['restore']))
|
||||
{
|
||||
$edited_file = $_POST['edited_file'];
|
||||
$content_file = file_get_contents(get_bak_file($edited_file));
|
||||
|
@ -292,7 +292,7 @@ if (isset($_POST['restore']) and !is_adviser())
|
|||
// +-----------------------------------------------------------------------+
|
||||
// | Save file
|
||||
// +-----------------------------------------------------------------------+
|
||||
if (isset($_POST['submit']) and !is_adviser())
|
||||
if (isset($_POST['submit']))
|
||||
{
|
||||
if (!is_webmaster())
|
||||
{
|
||||
|
|
|
@ -30,8 +30,6 @@ $refresh_main = false;
|
|||
|
||||
if ( isset($_GET['view_as']) )
|
||||
{
|
||||
if ( is_adviser() and $user['id']!=$_GET['view_as'] and $conf['guest_id']!=$_GET['view_as'])
|
||||
die('security error');
|
||||
if ($user['id']===$_GET['view_as'])
|
||||
pwg_unset_session_var( 'multiview_as' );
|
||||
else
|
||||
|
@ -111,14 +109,7 @@ $my_url = get_root_url().'plugins/'.basename(dirname(__FILE__)).'/'.basename(__F
|
|||
// | users |
|
||||
$query = '
|
||||
SELECT '.$conf['user_fields']['id'].' AS id,'.$conf['user_fields']['username'].' AS username
|
||||
FROM '.USERS_TABLE;
|
||||
if (is_adviser())
|
||||
{
|
||||
$query .='
|
||||
WHERE '.$conf['user_fields']['id']. ' IN ('.$user['id'].','.$conf['guest_id'].')
|
||||
';
|
||||
}
|
||||
$query .='
|
||||
FROM '.USERS_TABLE.'
|
||||
ORDER BY CONVERT('.$conf['user_fields']['username'].',CHAR)
|
||||
;';
|
||||
$user_map = simple_hash_from_query($query, 'id', 'username');
|
||||
|
|
Loading…
Reference in a new issue