diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc
index 672deee7f8d4041c0369523cee3d05033d73daed..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);
$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->setCurrentBase($this->DivListUsers->selectedBase);
- #$filter->update();
- #session::set('autocomplete', $filter);
- #if (!$filter->isValid()){
+ ## 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
- #$headpage = new listing(get_template_path("user-list.xml", true));
- #$headpage->registerFilter("accountProperties", "userManagement::filterProperties");
- #$headpage->setFilter($filter);
+ #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!
- #print_a($headpage->getAction());
+ #$action= $this->headpage->getAction();
+ #if ($action['action'] != '') {
+ # echo "List detected action:";
+ # print_a($action);
+ #}
## Refresh for filter
- #$headpage->update();
+ #$this->headpage->update();
#
- #return($headpage->render());
+ #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= "";
/* 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)".