mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-28 04:09:56 +03:00
related to #1530 status verification for option pages in configuration section
This commit is contained in:
parent
967cbe5e2a
commit
d0a331a4b5
9 changed files with 25 additions and 8 deletions
|
@ -11,6 +11,11 @@ if( !defined("PHPWG_ROOT_PATH") )
|
||||||
die ("Hacking attempt!");
|
die ("Hacking attempt!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!is_webmaster())
|
||||||
|
{
|
||||||
|
$page['warnings'][] = l10n('Webmaster status is required.');
|
||||||
|
}
|
||||||
|
|
||||||
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
|
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
|
||||||
include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php');
|
include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php');
|
||||||
include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
|
include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
|
||||||
|
@ -253,7 +258,7 @@ if (isset($_POST['submit']))
|
||||||
}
|
}
|
||||||
|
|
||||||
// updating configuration if no error found
|
// updating configuration if no error found
|
||||||
if (!in_array($page['section'], array('sizes', 'watermark')) and count($page['errors']) == 0)
|
if (!in_array($page['section'], array('sizes', 'watermark')) and count($page['errors']) == 0 and is_webmaster())
|
||||||
{
|
{
|
||||||
//echo '<pre>'; print_r($_POST); echo '</pre>';
|
//echo '<pre>'; print_r($_POST); echo '</pre>';
|
||||||
$result = pwg_query('SELECT param FROM '.CONFIG_TABLE);
|
$result = pwg_query('SELECT param FROM '.CONFIG_TABLE);
|
||||||
|
@ -602,6 +607,8 @@ switch ($page['section'])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$template->assign('isWebmaster', (is_webmaster()) ? 1 : 0);
|
||||||
|
|
||||||
//----------------------------------------------------------- sending html code
|
//----------------------------------------------------------- sending html code
|
||||||
$template->assign_var_from_handle('ADMIN_CONTENT', 'config');
|
$template->assign_var_from_handle('ADMIN_CONTENT', 'config');
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -11,6 +11,11 @@ if( !defined("PHPWG_ROOT_PATH") )
|
||||||
die ("Hacking attempt!");
|
die ("Hacking attempt!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!is_webmaster())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$errors = array();
|
$errors = array();
|
||||||
|
|
||||||
// original resize
|
// original resize
|
||||||
|
|
|
@ -11,6 +11,11 @@ if( !defined("PHPWG_ROOT_PATH") )
|
||||||
die ("Hacking attempt!");
|
die ("Hacking attempt!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!is_webmaster())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
function get_watermark_filename($list, $candidate, $step = 0)
|
function get_watermark_filename($list, $candidate, $step = 0)
|
||||||
{
|
{
|
||||||
global $change_name;
|
global $change_name;
|
||||||
|
|
|
@ -153,7 +153,7 @@
|
||||||
</div> <!-- configContent -->
|
</div> <!-- configContent -->
|
||||||
|
|
||||||
<p class="formButtons">
|
<p class="formButtons">
|
||||||
<button name="submit" type="submit" class="buttonLike">
|
<button name="submit" type="submit" class="buttonLike" {if $isWebmaster != 1}disabled{/if}>
|
||||||
<i class="icon-floppy"></i> {'Save Settings'|@translate}
|
<i class="icon-floppy"></i> {'Save Settings'|@translate}
|
||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -52,8 +52,8 @@
|
||||||
|
|
||||||
<p class="bottomButtons">
|
<p class="bottomButtons">
|
||||||
<input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
|
<input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
|
||||||
<input class="submit" type="submit" name="validate" value="{'Submit'|translate}">
|
<input class="submit" type="submit" name="validate" value="{'Submit'|translate}" {if $isWebmaster != 1}disabled{/if}>
|
||||||
<input class="submit" type="reset" name="reset" value="{'Reset'|translate}">
|
<input class="submit" type="reset" name="reset" value="{'Reset'|translate}" {if $isWebmaster != 1}disabled{/if}>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -312,7 +312,7 @@
|
||||||
</div> <!-- configContent -->
|
</div> <!-- configContent -->
|
||||||
|
|
||||||
<p class="formButtons">
|
<p class="formButtons">
|
||||||
<button name="submit" type="submit" class="buttonLike">
|
<button name="submit" type="submit" class="buttonLike" {if $isWebmaster != 1}disabled{/if}>
|
||||||
<i class="icon-floppy"></i> {'Save Settings'|@translate}
|
<i class="icon-floppy"></i> {'Save Settings'|@translate}
|
||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -236,7 +236,7 @@ jQuery("input[name='mail_theme']").change(function() {
|
||||||
</div> <!-- configContent -->
|
</div> <!-- configContent -->
|
||||||
|
|
||||||
<p class="formButtons">
|
<p class="formButtons">
|
||||||
<button name="submit" type="submit" class="buttonLike">
|
<button name="submit" type="submit" class="buttonLike" {if $isWebmaster != 1}disabled{/if}>
|
||||||
<i class="icon-floppy"></i> {'Save Settings'|@translate}
|
<i class="icon-floppy"></i> {'Save Settings'|@translate}
|
||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -241,7 +241,7 @@ $(".restore-settings-button").each(function() {
|
||||||
</div> <!-- configContent -->
|
</div> <!-- configContent -->
|
||||||
|
|
||||||
<p class="formButtons">
|
<p class="formButtons">
|
||||||
<button name="submit" type="submit" class="buttonLike">
|
<button name="submit" type="submit" class="buttonLike" {if $isWebmaster != 1}disabled{/if}>
|
||||||
<i class="icon-floppy"></i> {'Save Settings'|@translate}
|
<i class="icon-floppy"></i> {'Save Settings'|@translate}
|
||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -132,7 +132,7 @@
|
||||||
</div> <!-- configContent -->
|
</div> <!-- configContent -->
|
||||||
|
|
||||||
<p class="formButtons">
|
<p class="formButtons">
|
||||||
<button name="submit" type="submit" class="buttonLike">
|
<button name="submit" type="submit" class="buttonLike" {if $isWebmaster != 1}disabled{/if}>
|
||||||
<i class="icon-floppy"></i> {'Save Settings'|@translate}
|
<i class="icon-floppy"></i> {'Save Settings'|@translate}
|
||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue