-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.save_config.php
More file actions
66 lines (61 loc) · 2.28 KB
/
Copy pathaction.save_config.php
File metadata and controls
66 lines (61 loc) · 2.28 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/*
This file is part of CMS Made Simple module: Tourney.
Copyright (C) 2014-2016 Tom Phane <tpgww@onepost.net>
Refer to licence and other details at the top of file Tourney.module.php
More info at http://dev.cmsmadesimple.org/projects/tourney
*/
if(!$this->CheckAccess('modify')) exit;
if(isset($params['cancel']))
{
unset ($params);
$this->Redirect($id,'defaultadmin');
}
$errkey = FALSE;
$this->SetPreference('last_match_name',$params['tmt_final']);
$this->SetPreference('2ndlast_match_name',$params['tmt_semi']);
$this->SetPreference('3rdlast_match_name',$params['tmt_quarter']);
$this->SetPreference('4thlast_match_name',$params['tmt_eighth']);
$this->SetPreference('other_match_name',$params['tmt_roundname']);
$this->SetPreference('against_name',$params['tmt_versus']);
$this->SetPreference('noop_name',$params['tmt_bye']);
$this->SetPreference('forfeit_name',$params['tmt_forfeit']);
$this->SetPreference('abandon_name',$params['tmt_nomatch']);
if(isset($params['tmt_phoneid']))
$this->SetPreference('phone_regex',trim($params['tmt_phoneid'])); //excludes pre- post-
$this->SetPreference('time_zone',$params['tmt_timezone']);
$this->SetPreference('time_format',$params['tmt_time_format']);
$this->SetPreference('date_format',$params['tmt_date_format']);
$subdir = trim($params['tmt_uploads_dir']," /\\\t\n\r");
if(!$subdir)
$subdir = $this->GetName();
$updir = $config['uploads_path'];
if($updir)
{
$updir .= DIRECTORY_SEPARATOR.$subdir;
if(is_dir($updir) || mkdir($updir,0755))
$this->SetPreference('uploads_dir',$subdir);
else
$errkey = 'err_uploaddir'; //TODO can't create
}
else
$errkey = 'err_uploaddir'; //can't find
//$this->SetPreference('export_file',$params['tmt_export_file']);
//$this->SetPreference('strip_on_export',$params['tmt_strip_on_export']);
$this->SetPreference('export_encoding',$params['tmt_export_encoding']);
/*
$cfuncs = new Tourney\Crypter($this);
$key = Tourney\Crypter::MKEY;
$oldpw = $cfuncs->decrypt_preference($key);
$newpw = trim($params['tmt_'.$key]);
if($oldpw != $newpw) {
//TODO update all data which uses password
$cfuncs->encrypt_preference($key,$newpw);
}
*/
unset($params);
$msg = ($errkey) ?
$this->PrettyMessage($errkey,FALSE) : $this->PrettyMessage('prefs_updated');
$this->Redirect($id,'defaultadmin','',
array('showtab'=>2,'tmt_message'=>$msg));
?>