forked from OpenCorpora/opencorpora
-
Notifications
You must be signed in to change notification settings - Fork 1
/
options.php
46 lines (46 loc) · 1.58 KB
/
options.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
require('lib/header.php');
if (is_logged()) {
if (isset($_GET['act'])) {
$action = $_GET['act'];
} else
$action = '';
switch ($action) {
case 'save':
save_user_options($_POST);
alert_set('success','Настройки сохранены');
header('Location:options.php');
break;
case 'save_team':
save_user_team($_POST['team_id'], $_POST['new_team_name']);
alert_set('success','Настройки сохранены');
header('Location:options.php');
break;
case 'readonly_on':
if (is_admin()) {
set_readonly_on();
header('Location:options.php');
return;
} else
show_error($config['msg']['notadmin']);
break;
case 'readonly_off':
if (is_admin()) {
set_readonly_off();
header('Location:options.php');
return;
} else
show_error($config['msg']['notadmin']);
break;
default:
$smarty->assign('meta', get_meta_options());
$smarty->assign('current_email', get_user_email($_SESSION['user_id']));
$smarty->assign('current_name', get_user_shown_name($_SESSION['user_id']));
$smarty->assign('teams',get_team_list());
$smarty->assign('user_team',get_user_team($_SESSION['user_id']));
$smarty->display('options.tpl');
}
} else
show_error($config['msg']['notlogged']);
log_timing();
?>