source: extensions/virtualAutoGrant/VAG_admin.php @ 6619

Last change on this file since 6619 was 6619, checked in by vdigital, 14 years ago

Fix: Missing translations
Fix: Who can see in general case

Testing phase - unstable version

File size: 1.9 KB
Line 
1<?php
2/* Configuration of Panoramas */
3if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
4if (!defined('IN_ADMIN') or !IN_ADMIN) die('Hacking attempt!');
5load_language('plugin.lang', VAG_PATH);
6
7global $conf, $template, $user;
8$errors = array();
9$infos = array();
10
11$vag = & $conf['virtual_AutoGrant'];
12
13$sub = ( isset($_POST['submit']) ) ? true : false;
14
15if ( $sub ) {
16  $nsp = array_merge($vag, $_POST);
17  if ( $user['id'] != $conf['webmaster_id'] and $nsp['grant_to_webmaster'] != $vag['grant_to_webmaster']) {
18    $nsp['grant_to_webmaster'] = $vag['grant_to_webmaster'];
19    array_push($infos, l10n('Grant automatically the default webmaster has been reset to its previous value.'));
20  }
21        // if ( count($errors) > 0 )
22        // array_push($errors, l10n('Your configuration is NOT saved due to above reasons.'));
23  if ( !is_webmaster() and count($errors) == 0 )
24    array_push($infos, l10n('You are not authorized to change this configuration (Webmaster only).'));
25  if ( is_webmaster() and count($errors) == 0 )
26  {
27    $nsp = array_merge( $vag, array_intersect_key($nsp, $vag) );
28    // var_dump($nsp);
29    $confvag = serialize($nsp);
30    conf_update_param('virtual_AutoGrant', $confvag);
31        array_push($infos, l10n('Your configuration is saved.'));
32  }
33  $vag = array_merge($vag, $nsp);
34}
35$template->set_filenames( array('VAG_admin' => dirname(__FILE__).'/template/VAG_admin.tpl') );
36// foreach ($vag as $k => & $v) {
37  // if (is_string($v)) $vag[$k] = htmlspecialchars($v, ENT_QUOTES, 'utf-8');
38  // else $vag[$k] = $v;
39// }
40// if (count($errors) != 0) $template->assign('errors', $errors);
41if (count($infos) != 0) $template->assign('infos', $infos);
42$vag = array_merge( $vag, array(
43        'Dir' => VAG_DIR,
44        'Path' => VAG_PATH,
45        'Ver' => VAG_VER,
46  ));
47$template->assign( 'VAG', $vag );
48$template->assign_var_from_handle('ADMIN_CONTENT', 'VAG_admin');
49?>
Note: See TracBrowser for help on using the repository browser.