diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc
index 8b8848a833ad952a1c1dbad6e4640613e885ab21..f3bb656588e81fc3f83daa842aa21eab0336e824 100644 (file)
var $templates = array();
var $got_uid = false;
var $CopyPasteHandler = NULL;
+ var $SnapshotHandler = NULL;
var $CPPasswordChange = ""; // Contains the entry id which should get a new password
var $DivListUsers;
var $acl_module = array("users");
var $dns = array();
+ // Filter/headpage tests
+ var $filter= null;
+ var $headpage= null;
+
+
function userManagement(&$config, $ui)
{
/* Save configuration for internal use */
if ($this->config->boolValueIsTrue("main", "copyPaste")){
$this->CopyPasteHandler= new CopyPasteHandler($this->config);
}
+ if($this->config->get_cfg_value("enableSnapshots") == "true"){
+ $this->SnapshotHandler= new SnapshotHandler($this->config);
+ }
/* Creat dialog object */
$this->DivListUsers = new divListUsers($this->config,$this);
$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);
}
}
}
}
/* 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
+ #if (!$this->filter) {
+ # $this->filter = new filter(get_template_path("user-filter.xml", true));
+ # $this->filter->setObjectStorage(get_people_ou());
+ #}
+ #$this->filter->update();
+ #session::set('autocomplete', $this->filter);
+ #if (!$this->filter->isValid()){
+ # msg_dialog::display(_("Filter error"), _("The filter is uncomplete!"), ERROR_DIALOG);
+ #}
+
+ ## Build headpage
+ #if (!$this->headpage){
+ # $this->headpage = new listing(get_template_path("user-list.xml", true));
+ # $this->headpage->registerElementFilter("accountProperties", "userManagement::filterProperties");
+ # $this->headpage->registerElementFilter("lockLabel", "userManagement::filterLockLabel");
+ # $this->headpage->registerElementFilter("lockImage", "userManagement::filterLockImage");
+ # $this->headpage->setFilter($this->filter);
+ #}
+
+ ## Needs to be called before update!
+ #$action= $this->headpage->getAction();
+ #if ($action['action'] != '') {
+ # echo "List detected action:";
+ # print_a($action);
+ #}
+
+ ## Refresh for filter
+ #$this->headpage->update();
+ #
+ #return($this->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()
{
/* Setup filter depending on selection */
$filter="";
- if ($this->config->get_cfg_value("sambaversion") == 3){
- $samba= "sambaSamAccount";
- } else {
- $samba= "sambaAccount";
- }
+ $samba= "sambaSamAccount";
if ($ShowFunctionalUsers){
$filter.= "(&(objectClass=gosaAccount)(!(|(objectClass=posixAccount)".