summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e838750)
raw | patch | inline | side by side (parent: e838750)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 25 Jul 2008 12:11:37 +0000 (12:11 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 25 Jul 2008 12:11:37 +0000 (12:11 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12048 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc b/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc
index 9d5cdf1074e4e70d667a5ca6bc89231e1af9114e..6a5801781932d8242c3b84416bfbd47694f1b61c 100644 (file)
/* Copy & Paste enabled ?
*/
- if((isset($this->config->data['MAIN']['ENABLECOPYPASTE']))&&(preg_match("/true/i",$this->config->data['MAIN']['ENABLECOPYPASTE'] ))){
+ if ($this->config->get_cfg_value("enablecopypaste") == "true"){
$this->CopyPasteHandler = new CopyPasteHandler($this->config);
}
diff --git a/gosa-core/plugins/admin/ogroups/tabs_ogroups.inc b/gosa-core/plugins/admin/ogroups/tabs_ogroups.inc
index 47af9e79ae6ac30f61ecf813c05d62316ca23f65..a2ea7c23e079a19d603f7ecdfff13e3a1c9d9e89 100644 (file)
/* Add mail group tab , if there is curerntly no mail tab defined */
if(class_available("mailogroup")){
if((preg_match("/U/",$objects))&&(!isset($this->by_object['mailogroup']))){
- if(isset($this->config->current['MAILMETHOD'])){
- if (preg_match('/kolab/i', $this->config->current['MAILMETHOD'])){
- $this->by_name['mailogroup']= _("Mail");
- $this->by_object['mailogroup']= new mailogroup($this->config, $this->dn);
- $this->by_object['mailogroup']->parent= &$this;
- }
+ if ($this->config->get_cfg_value("mailmethod") == "kolab"){
+ $this->by_name['mailogroup']= _("Mail");
+ $this->by_object['mailogroup']= new mailogroup($this->config, $this->dn);
+ $this->by_object['mailogroup']->parent= &$this;
}
}
}
/* Add a user tab used for mail distribution lists */
if(class_available("mailogroup")){
- if(isset($this->config->current['MAILMETHOD'])){
- if (preg_match('/kolab/i', $this->config->current['MAILMETHOD'])){
- $this->by_name['mailogroup']= _("Mail");
- $this->by_object['mailogroup']= new mailogroup($this->config, $this->dn);
- $this->by_object['mailogroup']->parent= &$this;
- }
+ if ($this->config->get_cfg_value("mailmethod") == "kolab"){
+ $this->by_name['mailogroup']= _("Mail");
+ $this->by_object['mailogroup']= new mailogroup($this->config, $this->dn);
+ $this->by_object['mailogroup']->parent= &$this;
}
}
diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc
index 2588483f066fdb6a12ce7df60c74df42776bc1a8..f94edf17232222efb47fb1a6a9ad7b98bae833dd 100644 (file)
if(!change_password ($this->usertab->dn, $_POST['new_password'],0, $obj->pw_storage)){
return($smarty->fetch(get_template_path('password.tpl', TRUE)));
}
- if (isset($config->data['MAIN']['EXTERNALPWDHOOK'])){
- exec($config->data['MAIN']['EXTERNALPWDHOOK']." ".$username." ".$_POST['new_password'], $resarr);
+ if ($config->get-cfg_value("externalpwdhook") != ""){
+ exec($config->get-cfg_value("externalpwdhook")." ".$username." ".$_POST['new_password'], $resarr);
}
new log("modify","users/".get_class($this),$this->usertab->dn,array(),"Password has been changed");
unset($this->usertab);
if(!change_password ($this->dn, $_POST['new_password'])){
return($smarty->fetch(get_template_path('password.tpl', TRUE)));
}
- if (isset($config->data['MAIN']['EXTERNALPWDHOOK'])){
- exec($config->data['MAIN']['EXTERNALPWDHOOK']." ".$username." ".$_POST['new_password'], $resarr);
+ if ($config->get-cfg_value("externalpwdhook") != ""){
+ exec($config->get-cfg_value("externalpwdhook")." ".$username." ".$_POST['new_password'], $resarr);
}
new log("modify","users/".get_class($this),$this->dn,array(),"Password has been changed");
}
react on this. */
$this->dn= "new";
- if (isset($this->config->current['IDGEN'])){
- $this->got_uid= false;
- } else {
- $this->got_uid= true;
- }
+ $this->got_uid= ($this->config->get_cfg_value("idgen") == "");
/* Create new usertab object */
$this->usertab= new usertabs($this->config,$this->config->data['TABS']['USERTABS'], $this->dn);
msg_dialog::displayChecks($message);
} else {
$attributes= array('sn' => $this->sn, 'givenName' => $this->givenName);
- if (isset($this->config->current['IDGEN']) &&
- $this->config->current['IDGEN'] != ""){
- $uids= gen_uids ($this->config->current['IDGEN'], $attributes);
+ if ($this->config->get_cfg_value("idgen") != ""){
+ $uids= gen_uids ($this->config->get_cfg_value("idgen"), $attributes);
if (count($uids)){
$smarty->assign("edit_uid", "false");
$smarty->assign("uids", $uids);
/* Setup filter depending on selection */
$filter="";
- if ($this->config->current['SAMBAVERSION'] == 3){
+ if ($this->config->get_cfg_value("sambaversion") == 3){
$samba= "sambaSamAccount";
} else {
$samba= "sambaAccount";
diff --git a/gosa-core/plugins/personal/generic/class_user.inc b/gosa-core/plugins/personal/generic/class_user.inc
index 1446d1f009bff740810bb5223626c5d859be73c2..5b7e299f984b2aee42a3ee1bbc449459ff893cbf 100644 (file)
{
$this->config= $config;
/* Configuration is fine, allways */
- if (isset($this->config->current['GOVERNMENTMODE']) && preg_match("/true/i",$this->config->current['GOVERNMENTMODE'])){
+ if($this->config->get_cfg_value("governmentmode") == "true"){
$this->governmentmode = TRUE;
$this->attributes=array_merge($this->attributes,$this->govattrs);
}
}
/* Make hash default to md5 if not set in config */
- if (!isset($this->config->current['HASH'])){
- $hash= "md5";
- } else {
- $hash= $this->config->current['HASH'];
- }
+ $hash= $this->config->get_cfg_value("hash", "crypt/md5");
/* Load data from LDAP? */
if ($dn !== NULL){
/* Prepare password hashes */
if ($this->pw_storage == ""){
- $this->pw_storage= $this->config->current['HASH'];
+ $this->pw_storage= $this->config->get_cfg_value("hash");
}
$temp= passwordMethod::get_available_methods();
die ("Could not connect to LDAP server");
}
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
- if (function_exists("ldap_set_rebind_proc") && isset($this->config->current['RECURSIVE']) && $this->config->current['RECURSIVE'] == "true") {
+ if (function_exists("ldap_set_rebind_proc") && $this->config->get_cfg_value("recursive") == "true") {
ldap_set_option($this->cid, LDAP_OPT_REFERRALS, 1);
ldap_set_rebind_proc($ds, array(&$this, "rebind"));
}
- if(isset($config->current['TLS']) && $config->current['TLS'] == "true"){
+ if($this->config->get_cfg_value("tls") == "true"){
ldap_start_tls($ds);
}
if (!($res = @ldap_bind($ds, $this->config->current['ADMIN'],
function update_new_dn()
{
$pt= "";
- if(isset($this->config->current['INCLUDE_PERSONAL_TITLE']) && preg_match("/true/i",$this->config->current['INCLUDE_PERSONAL_TITLE'])){
+ if($this->config->get_cfg_value("include_personal_title") == "true"){
if(!empty($this->personalTitle)){
$pt = $this->personalTitle." ";
}
$this->cn= $pt.$this->givenName." ".$this->sn;
/* Permissions for that base? */
- if (isset($this->config->current['DNMODE']) && $this->config->current['DNMODE'] == "uid"){
+ if ($this->config->get_cfg_value("dnmode") == "uid"){
$this->new_dn= 'uid='.$this->uid.','.get_people_ou().$this->base;
} else {
/* Don't touch dn, if cn hasn't changed */
if ($this->uid == ""){
$message[]= msgPool::required(_("Login"));
}
- if (!(isset($this->config->current['DNMODE']) && $this->config->current['DNMODE'] == "uid")){
+ if ($this->config->get_cfg_value("dnmode") != "uid"){
$ldap->cat($this->new_dn);
if ($ldap->count() != 0 && $this->dn != $this->new_dn && $this->dn == 'new'){
$message[]= msgPool::duplicated(_("Name"));
{
$ds= ldap_connect($this->config->current['SERVER']);
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
- if (function_exists("ldap_set_rebind_proc") && isset($this->config->current['RECURSIVE']) && $this->config->current['RECURSIVE'] == "true") {
+ if (function_exists("ldap_set_rebind_proc") && $this->config->get_cfg_value("recursive") == "true"){
ldap_set_option($this->cid, LDAP_OPT_REFERRALS, 1);
ldap_set_rebind_proc($ds, array(&$this, "rebind"));
}
- if(isset($this->config->current['TLS']) &&
- $this->config->current['TLS'] == "true"){
-
+ if ($this->config->get_cfg_value("tls") == "true"){
ldap_start_tls($ds);
}
/* Append government attributes if required */
global $config;
- if (isset($config->current['GOVERNMENTMODE']) && preg_match('/true/i', $config->current['GOVERNMENTMODE'])){
+ if($this->config->get_cfg_value("governmentmode") == "true"){
foreach($govattrs as $attr => $desc){
$ret["plProvidedAcls"][$attr] = $desc;
}
diff --git a/gosa-core/plugins/personal/password/class_password.inc b/gosa-core/plugins/personal/password/class_password.inc
index ee88461232f75177821c6efbd960bc4e1404ec91..d4899ec2efe63d9a0af591d9c5b6bfb5355a5ae9 100644 (file)
$smarty->assign("NotAllowed" , !preg_match("/w/i",$password_ACLS));
/* Display expiration template */
- if((isset($this->config->data['MAIN']['ACCOUNT_EXPIRATION'])) &&
- preg_match('/true/i', $this->config->data['MAIN']['ACCOUNT_EXPIRATION'])){
+ if ($this->config->get_cfg_value("account_expiration") == "true"){
$expired= ldap_expired_account($this->config, $ui->dn, $ui->username);
if($expired == 4){
return($smarty->fetch(get_template_path("nochange.tpl", TRUE)));
if (isset($_POST['password_finish'])){
/* Should we check different characters in new password */
- $check_differ = isset($this->config->data['MAIN']['PWDIFFER']);
- $differ = @$this->config->data['MAIN']['PWDIFFER'];
+ $check_differ = $this->config->get_cfg_value("pwdiffer") != "";
+ $differ = $this->config->get_cfg_value("pwdiffer", 0);
/* Enable length check ? */
- $check_length = isset($this->config->data['MAIN']['PWMINLEN']);
- $length = @$this->config->data['MAIN']['PWMINLEN'];
+ $check_length = $this->config->get_cfg_value("pwminlen") != "";
+ $length = $this->config->get_cfg_value("pwminlen", 0);
/* Call external password quality hook ?*/
- $check_hook = isset($this->config->data['MAIN']['EXTERNALPWDHOOK']);
- $hook = @$this->config->data['MAIN']['EXTERNALPWDHOOK']." ".$ui->username." ".$_POST['current_password']." ".$_POST['new_password'];
+ $check_hook = $this->config->get_cfg_value("externalpwdhook") != "";
+ $hook = $this->config->get_cfg_value("externalpwdhook")." ".$ui->username." ".$_POST['current_password']." ".$_POST['new_password'];
if($check_hook){
exec($hook,$resarr);
$check_hook_output = "";
$ui->dn,
$_POST['current_password'],
$this->config->current['SERVER'],
- isset($this->config->current['RECURSIVE']) && preg_match("/true/i",$this->config->current['RECURSIVE']),
- isset($this->config->current['TLS']) && preg_match("/true/i",$this->config->current['TLS']));
+ $this->config->get_cfg-value("recursive") == "true",
+ $this->config->get_cfg-value("tls") == "true");
/* connection Successfull ? */
if (!$tldap->success()){
diff --git a/gosa-core/plugins/personal/posix/class_posixAccount.inc b/gosa-core/plugins/personal/posix/class_posixAccount.inc
index 8a3971073415f14d7bab3b264fc2989e8495fb57..f2471b602a9b0d211764ad2d6d2a4251f99943a6 100644 (file)
/* Create group if it doesn't exist */
if ($ldap->count() == 0){
- $groupdn= preg_replace ('/^'.$this->config->current['DNMODE'].'=[^,]+,'.get_people_ou().'/i', 'cn='.$this->uid.','.get_groups_ou(), $this->dn);
+ $groupdn= preg_replace ('/^'.$this->config->get_cfg_value("dnmode").'=[^,]+,'.get_people_ou().'/i', 'cn='.$this->uid.','.get_groups_ou(), $this->dn);
$g= new group($this->config, $groupdn);
$g->cn= $this->uid;
if (!tests::is_id($this->uidNumber)){
$message[]= msgPool::invalid(_("UID"), $this->uidNumber, "/[0-9]/");
} else {
- if ($this->uidNumber < $this->config->current['MINID']){
- $message[]= msgPool::toosmall(_("UID"), $this->config->current['MINID']);
+ if ($this->uidNumber < $this->config->get_cfg_value("minid")){
+ $message[]= msgPool::toosmall(_("UID"), $this->config->get_cfg_value("minid"));
}
}
if (!tests::is_id($this->gidNumber)){
$message[]= msgPool::invalid(_("GID"), $this->gidNumber, "/[0-9]/");
} else {
- if ($this->gidNumber < $this->config->current['MINID']){
- $message[]= msgPool::toosmall(_("GID"), $this->config->current['MINID']);
+ if ($this->gidNumber < $this->config->get_cfg_value("minid")){
+ $message[]= msgPool::toosmall(_("GID"), $this->config->get_cfg_value("minid"));
}
}
}
/* get the ranges */
$tmp = array('0'=> 1000);
- if (preg_match('/posixAccount/', $oc) && isset($this->config->current['UIDBASE'])) {
- $tmp= split('-',$this->config->current['UIDBASE']);
- } elseif(isset($this->config->current['GIDBASE'])){
- $tmp= split('-',$this->config->current['GIDBASE']);
+ if (preg_match('/posixAccount/', $oc) && $this->config->get_cfg_value("uidbase") != ""){
+ $tmp= split('-',$this->config->get_cfg_value("uidbase"));
+ } elseif($this->config->get_cfg_value("gidbase") != "")){
+ $tmp= split('-',$this->config->get_cfg_value("gidbase"));
}
/* Set hwm to max if not set - for backward compatibility */
}
/* Find out next free id near to UID_BASE */
- if (!isset($this->config->current['BASE_HOOK'])){
+ if ($this->config->get_cfg_value("base_hook") == ""){
$base= $lwm;
} else {
/* Call base hook */