summaryrefslogtreecommitdiff
path: root/lib/plugins/config/settings/extra.class.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2006-03-04 16:40:38 +0100
committerAndreas Gohr <andi@splitbrain.org>2006-03-04 16:40:38 +0100
commit1ca31cfe69e2d10cce65c4323eb652b355f4c904 (patch)
tree5783a2da2d5ef9ba40aef392b7ad959740125e4c /lib/plugins/config/settings/extra.class.php
parent7c6f82e59d762d68d99d1a88f449d1035ffa5f76 (diff)
downloadrpg-1ca31cfe69e2d10cce65c4323eb652b355f4c904.tar.gz
rpg-1ca31cfe69e2d10cce65c4323eb652b355f4c904.tar.bz2
simplified file permission handling
This patch simpliefies the configuration of the file and directory creation modes. There is no need to set the umask anymore. Only the wanted permissions for files and directories are set. An init function compares the wanted modes with the ones that would be choosen by the system automatically (consulting the system's umask) and sets the modes for chmod when needed. darcs-hash:20060304154038-7ad00-5ef1db3a87e42563a602f9d050c681d2ea74682f.gz
Diffstat (limited to 'lib/plugins/config/settings/extra.class.php')
-rw-r--r--lib/plugins/config/settings/extra.class.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/plugins/config/settings/extra.class.php b/lib/plugins/config/settings/extra.class.php
index 145e3c850..805806e8b 100644
--- a/lib/plugins/config/settings/extra.class.php
+++ b/lib/plugins/config/settings/extra.class.php
@@ -7,11 +7,11 @@
if (!class_exists('setting_sepchar')) {
class setting_sepchar extends setting_multichoice {
-
+
function setting_sepchar($key,$param=NULL) {
$str = '_-.';
- for ($i=0;$i<strlen($str);$i++) $this->_choices[] = $str{$i};
-
+ for ($i=0;$i<strlen($str);$i++) $this->_choices[] = $str{$i};
+
// call foundation class constructor
$this->setting($key,$param);
}
@@ -23,7 +23,7 @@ if (!class_exists('setting_savedir')) {
function update($input) {
if ($this->is_protected()) return false;
-
+
$value = is_null($this->_local) ? $this->_default : $this->_local;
if ($value == $input) return false;
@@ -32,7 +32,7 @@ if (!class_exists('setting_savedir')) {
$this->_input = $input;
return false;
}
-
+
$this->_local = $input;
return true;
}
@@ -50,7 +50,7 @@ if (!class_exists('setting_authtype')) {
sort($authtypes);
$this->_choices = $authtypes;
-
+
parent::initialize($default,$local,$protected);
}
}
@@ -61,18 +61,18 @@ if (!class_exists('setting_im_convert')) {
function update($input) {
if ($this->is_protected()) return false;
-
+
$input = trim($input);
-
+
$value = is_null($this->_local) ? $this->_default : $this->_local;
if ($value == $input) return false;
if ($input && !@file_exists($input)) {
$this->_error = true;
$this->_input = $input;
- return false;
+ return false;
}
-
+
$this->_local = $input;
return true;
}