diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc
index 98e2b87e9415b70d0a9e8be0ba5dd246ba07cb48..2b46d6c698595878c3ee46f879b2d1c66905eece 100644 (file)
plugin::execute();
/* LOCK MESSAGE Vars */
- session::global_set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^user_edit_/","/^user_del_/","/^item_selected/","/^remove_multiple_users/","/^multiple_edit/","/menu_action/"));
+ session::set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^user_edit_/","/^user_del_/","/^item_selected/","/^remove_multiple_users/","/^multiple_edit/","/menu_action/"));
$smarty = get_smarty(); // Smarty instance
$s_action = ""; // Contains the action to be taken
$type = $events['BY_CLASS'][$event];
$this->usertab = new $type['CLASS_NAME']($this->config);
$this->usertab->add_users($uids);
- $this->usertab->set_type(TRIGGERED_EVENT);
+ $this->usertab->set_type(SCHEDULED_EVENT);
}
}
}
$this->sn= "";
$this->givenName= "";
$this->uid= "";
- session::un_set('objectinfo');
+ set_object_info();
}
/* User is allowed to change passwords, save 'dn' and 'acl' for next
dialog. */
- session::set('objectinfo',$this->dn);
+ set_object_info($this->dn);
return ($smarty->fetch(get_template_path('password.tpl', TRUE)));
} else {
/* User is not allowed. Show message and cancel. */
/* Check locking, save current plugin in 'back_plugin', so
the dialog knows where to return. */
+
if (($user= get_lock($this->dn)) != ""){
return(gen_locked_message ($user, $this->dn,TRUE));
}
/* Set ACL and move DN to the headline */
$this->usertab->set_acl_base($this->dn);
- session::set('objectinfo',$this->dn);
+ set_object_info($this->dn);
}
if($tmp->multiple_available()){
$this->usertab = $tmp;
$this->usertab->set_active_tab($s_tab);
- session::set('objectinfo',$this->usertab->get_object_info());
+ set_object_info($this->usertab->get_object_info());
}
}
$this->sn= "";
$this->givenName= "";
$this->uid= "";
- session::un_set('objectinfo');
+ set_object_info();
}
/* Get entry check current status */
$val = $this->list[$s_entry];
if (!preg_match("/w/",$this->ui->get_permissions($val['dn'],"users/password"))){
- msg_dialog::display(_("Password locking"),
+ msg_dialog::display(_("Account locking"),
_("You have no permission to change the lock status for this user!"),WARNING_DIALOG);
}else{
$pwd = $val['userPassword'][0];
if (is_array($hn)){
$hn= $hn[0];
}
- msg_dialog::display(_("Password locking"),
+ msg_dialog::display(_("Account locking"),
sprintf(_("Password method '%s' does not support locking. Account has not been locked!"), $hn),WARNING_DIALOG);
}
}else{
unset ($this->usertab);
$this->usertab= NULL;
- session::un_set('objectinfo');
+ set_object_info();
}else{
/* Reinitialize tab */
/* Finish template preamble */
if (isset($_POST['template_continue']) && $_POST['template'] != 'none' && (isset($_POST['uid']))){
- /* Might not be filled if IDGEN is unset */
- $this->sn = $_POST['sn'];
- $this->givenName = $_POST['givenName'];
-
/* Move user supplied data to sub plugins */
- $this->uid = $_POST['uid'];
- $this->usertab->uid = $this->uid;
- $this->usertab->sn = $this->sn;
- $this->usertab->givenName = $this->givenName;
+ foreach(array("uid","sn","givenName") as $attr){
+ $this->$attr = $_POST[$attr];
+ $this->usertab->$attr = $this->$attr;
+ $this->usertab->by_object['user']->$attr = $this->$attr;
+ }
+
$template_dn = $_POST['template'];
- $this->usertab->adapt_from_template($template_dn);
+ $this->usertab->adapt_from_template($template_dn, array("uid","cn","givenName","sn"));
$template_base = preg_replace("/^[^,]+,".preg_quote(get_people_ou(), '/')."/", '', $template_dn);
$this->usertab->by_object['user']->base= $template_base;
}
}
/* Return rendered main page */
- /* Display dialog with system list */
$this->DivListUsers->parent = $this;
$this->DivListUsers->execute();
}
$this->reload();
$this->DivListUsers->setEntries($this->list);
+
+ # FILTER Test #################################################
+ ## Build filter
+ #$filter = new filter(get_template_path("user-filter.xml", true));
+ #$filter->setObjectStorage(get_people_ou());
+ #$filter->update();
+ #session::set('autocomplete', $filter);
+ #if (!$filter->isValid()){
+ # msg_dialog::display(_("Filter error"), _("The filter is uncomplete!"), ERROR_DIALOG);
+ #}
+
+ ## Build headpage
+ #$headpage = new listing(get_template_path("user-list.xml", true));
+ #$headpage->registerElementFilter("accountProperties", "userManagement::filterProperties");
+ #$headpage->registerElementFilter("lockLabel", "userManagement::filterLockLabel");
+ #$headpage->registerElementFilter("lockImage", "userManagement::filterLockImage");
+ #$headpage->setFilter($filter);
+
+ ## Needs to be called before update!
+ #$action= $headpage->getAction();
+ #if ($action['action'] != '') {
+ # echo "List detected action:";
+ # print_a($action);
+ #}
+
+ ## Refresh for filter
+ #$headpage->update();
+ #
+ #return($headpage->render());
+ ################################################### FILTER Test
+
return($this->DivListUsers->Draw());
}
+ static function filterLockImage($userPassword)
+ {
+ $image= "images/empty.png";
+
+ if(isset($userPassword[0]) && preg_match("/^\{[^\}]/",$userPassword[0])){
+ if(preg_match("/^[^\}]*+\}!/",$userPassword[0])){
+ $image= "images/lists/locked.png";
+ }else{
+ $image= "images/lists/unlocked.png";
+ }
+ }
+
+ return $image;
+ }
+
+
+ static function filterLockLabel($userPassword)
+ {
+ $label= "";
+
+ if(isset($userPassword[0]) && preg_match("/^\{[^\}]/",$userPassword[0])){
+ if(preg_match("/^[^\}]*+\}!/",$userPassword[0])){
+ $label= _("Unlock account");
+ }else{
+ $label= _("Lock account");
+ }
+ }
+
+ return $label;
+ }
+
+
+ static function filterProperties($dn, $row, $class)
+ {
+ $result= "";
+
+ $map= array( "gosaAccount" => array( "image" => "plugins/users/images/select_user.png",
+ "plugin" => "user",
+ "alt" => _("Generic"),
+ "title" => _("Edit generic properties")),
+ "posixAccount" => array("image" => "images/penguin.png",
+ "plugin" => "posixAccount",
+ "alt" => _("POSIX"),
+ "title" => _("Edit POSIX properties")),
+ "gosaMailAccount" => array("image" => "images/mailto.png",
+ "alt" => _("Mail"),
+ "plugin" => "mailAccount",
+ "title" => _("Edit mail properties")),
+ "sambaSamAccount" => array("image" => "plugins/systems/images/select_winstation.png",
+ "plugin" => "sambaAccount",
+ "alt" => _("Samba"),
+ "title" => _("Edit samba properties")),
+ "apple-user" => array("image" => "plugins/netatalk/images/select_netatalk.png",
+ "plugin" => "sambaAccount",
+ "alt" => _("Netatalk"),
+ "title" => _("Edit netatalk properties")),
+ "gotoEnvironment" => array("image" => "plugins/users/images/small_environment.png",
+ "plugin" => "gotoEnvironment",
+ "alt" => _("Environment"),
+ "title" => _("Edit environment properties")),
+ "goFaxAccount" => array("image" => "plugins/users/images/fax_small.png",
+ "plugin" => "goFaxAccount",
+ "alt" => _("FAX"),
+ "title" => _("Edit FAX properties")),
+ "goFonAccount" => array("image" => "plugins/gofon/images/select_phone.png",
+ "plugin" => "goFonAccount",
+ "alt" => _("Phone"),
+ "title" => _("Edit phone properties")));
+
+ // Walk thru map
+ foreach ($map as $oc => $properties) {
+ if (in_array($oc, $class)) {
+ $result.="<input class='center' type='image' src='".$properties['image']."' ".
+ "alt='".$properties['alt']."' title='".$properties['title'].
+ "' name='listing_edit_".$properties['plugin']."_$row' style='padding:1px'>";
+ } else {
+ $result.="<img src='images/empty.png' alt=' ' class='center' style='padding:1px'>";
+ }
+ }
+
+ return $result;
+ }
+
+
+
/* Return departments, that will be included within snapshot detection */
function get_used_snapshot_bases()
{