diff --git a/gosa-core/plugins/admin/users/class_divListUsers.inc b/gosa-core/plugins/admin/users/class_divListUsers.inc
index eddb2bd024e8ff2a942eada5bb2a10293c4929a1..e9698c400f683b8005f1283b882dcd91f0e7c95e 100644 (file)
var $ShowMailUsers;
var $ShowSambaUsers;
var $ShowProxyUsers;
+ var $ShowPhoneUsers;
/* Subsearch checkbox */
var $SubSearch = false;
}
/* Toggle all selected / deselected */
- $chk = "<input type='checkbox' id='select_all' name='select_all'
+ $chk = "<input type='checkbox' id='select_all' name='select_all' title='"._("Select all")."'
onClick='toggle_all_(\"^item_selected_[0-9]*$\",\"select_all\");' >";
/* set Page header */
$this->AddCheckBox("ShowSambaUsers" ,msgPool::selectToView(_("Samba"),"enabled") ,sprintf(_("Show %s"),_("samba users")), true);
$this->AddCheckBox("ShowProxyUsers" ,msgPool::selectToView(_("Proxy"),"enabled") ,sprintf(_("Show %s"),_("proxy users")), true);
+ if(class_available("phoneAccount")){
+ $this->AddCheckBox("ShowPhoneUsers" ,msgPool::selectToView(_("Phone"),"enabled") ,sprintf(_("Show %s"),_("phone users")), true);
+ }
+
/* Add SubSearch checkbox */
$this->AddCheckBox(SEPERATOR);
$this->AddCheckBox("SubSearch", msgPool::selectToView("","subsearch"), msgPool::selectToView("","subsearch_small"), false);
function GenHeader()
{
- /* Prepare departments,
- which are shown in the listbox on top of the listbox
- */
- $options= "";
-
/* Get all departments within this subtree */
$base = $this->config->current['BASE'];
-
- /* Add base */
- $tmp = array();
- $tmp[] = array("dn"=>$this->config->current['BASE']);
- $tmp= array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
- array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH));
-
- $deps = array();
- foreach($tmp as $tm){
- $deps[$tm['dn']] = $tm['dn'];
- }
-
-
- /* Load possible departments */
- $ui= get_userinfo();
- $tdeps= $ui->get_module_departments("users");
- $ids = $this->config->idepartments;
- $first = "";
- $found = FALSE;
- foreach($ids as $dep => $name){
- if(isset($deps[$dep]) && in_array_ics($dep, $tdeps)){
-
- /* Keep first base dn in mind, we could need this
- * info if no valid base was found
- */
- if(empty($first)) {
- $first = $dep['dn'];
- }
-
- $value = $ids[$dep];
- if ($this->selectedBase == $dep){
- $found = TRUE;
- $options.= "<option selected='selected' value='".$dep."'>$value</option>";
- } else {
- $options.= "<option value='".$dep."'>$value</option>";
- }
- }
- }
-
- /* The currently used base is not visible with your acl setup.
- * Set base to first useable base.
- */
- if(!$found){
- $this->selectedBase = $first;
- }
+ $options = $this->create_department_list($this->module);
/* Get copy & paste icon */
- $acl_all = $ui->has_complete_category_acls($this->selectedBase,"users") ;
+ $ui = get_userinfo();
$acl = $ui->get_permissions($this->selectedBase,"users/user");
/* Add default header */
$listhead = MultiSelectWindow::get_default_header();
$listhead .=
_("Base")." <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
- " <input class='center' type='image' src='images/list_submit.png' align='middle'
+ " <input class='center' type='image' src='images/lists/submit.png' align='middle'
title='"._("Submit department")."' name='submit_department' alt='". _("Submit")."'> ";
/* Create Layers menu */
$s = ".|"._("Actions")."|\n";
- $s .= "..|<img src='images/list_new.png' alt='' border='0' class='center'>".
- " "._("Create")."|\n";
/* Append create options */
if(preg_match("/c/",$acl)) {
- $s.= "...|<input class='center' type='image' src='images/list_new_user.png' alt=''>".
+ $s .= "..|<img src='images/lists/new.png' alt='' border='0' class='center'>".
+ " "._("Create")."|\n";
+ $s.= "...|<input class='center' type='image' src='plugins/users/images/list_new_user.png' alt=''>".
" "._("User")."|user_new|\n";
- $s.= "...|<input class='center' type='image' src='images/list_new.png' alt=''>".
+ $s.= "...|<input class='center' type='image' src='images/lists/new.png' alt=''>".
" "._("Template")."|user_tplnew|\n";
}
/* Multiple options */
$s.= "..|---|\n";
- $s.= "..|<img src='images/edit.png' alt='' border='0' class='center'>".
+ $s.= "..|<img src='images/lists/edit.png' alt='' border='0' class='center'>".
" "._("Edit")."|"."multiple_edit|\n";
- $s.= "..|<img src='images/list_password.png' alt='' border='0' class='center'>".
+ $s.= "..|<img src='plugins/users/images/list_password.png' alt='' border='0' class='center'>".
" "._("Change password")."|"."multiple_password_change|\n";
- $s.= "..|<img src='images/edittrash.png' alt='' border='0' class='center'>".
+ $s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
" "._("Remove")."|"."remove_multiple|\n";
+ $s.= "..|<img src='plugins/users/images/wizard.png' alt='' border='0' class='center'>".
+ " "._("Apply template")."|"."templatize_multiple|\n";
/* Add event tag */
if(class_available("DaemonEvent")){
}
}
- /* Add multiple copy & cut icons */
- if(is_object($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){
- $s.= "..|---|\n";
- $s.= "..|<img src='images/editcopy.png' alt='' border='0' class='center'>".
- " "._("Copy")."|"."multiple_copy_systems|\n";
- $s.= "..|<img src='images/editcut.png' alt='' border='0' class='center'>".
- " "._("Cut")."|"."multiple_cut_systems|\n";
-
- if($this->parent->CopyPasteHandler->entries_queued()){
- $img = "<img border='0' class='center' src='images/editpaste.png' alt=''>";
- $s.="..|".$img." "._("Paste")."|editPaste|\n";
- }else{
- $img = "<img border='0' class='center' src='images/cant_editpaste.png' alt=''>";
- $s.="..|".$img." "._("Paste")."\n";
- }
- }
-
- /* Add snapshot icons */
- if(preg_match("/(c.*w|w.*c)/",$acl_all)){
- $s .= "..|---|\n";
- $s .= $this->get_snapshot_header(TRUE);
- }
+ $s .= $this->parent->get_copypaste_header($this->selectedBase,$this->module);
+ $s .= $this->parent->get_snapshot_header($this->selectedBase,$this->module);
$this->SetDropDownHeaderMenu($s);
$this->SetListHeader($listhead);
/* Variable initialation */
$enviro = $posix = $maila = $faxac = $samba = $netatalk = "";
$empty = "<img class='center' src='images/empty.png' style='width:16px;height:16px;' alt='-'>";
- $userimg = "<img class='center' src='images/select_user.png' alt='User' title='%s'>";
- $tplimg = "<img class='center' src='images/select_template.png' alt='Template' title='%s'>";
+ $userimg = "<img class='center' src='plugins/users/images/select_user.png' alt='User' title='%s'>";
+ $tplimg = "<img class='center' src='plugins/users/images/select_template.png' alt='Template' title='%s'>";
$editlink = "<a href='?plug=".validate($_GET['plug'])."&id=%s&act=edit_entry'>%s</a>";
/* Dynamic action col, depending on snapshot icons */
"apple-user" => array("VAR"=>"netatalk" ,"IMG"=>"netatalkimg"));
/* Pictures for Extensions */
- $usrimg ="<input class='center' type='image' src='images/select_user.png' alt='"._("GOsa")."'
+ $usrimg ="<input class='center' type='image' src='plugins/users/images/select_user.png' alt='"._("GOsa")."'
name='user_edit_%KEY%-user' title='"._("Edit generic properties")."'>";
$posiximg = "<input class='center' type='image' src='images/penguin.png' alt='"._("Posix")."'
name='user_edit_%KEY%-posixAccount' title='"._("Edit UNIX properties")."'>";
- $eviroimg = "<input class='center' type='image' src='images/smallenv.png' alt='"._("Environment")."'
+ $eviroimg = "<input class='center' type='image' src='plugins/users/images/small_environment.png' alt='"._("Environment")."'
name='user_edit_%KEY%-environment' title='"._("Edit environment properties")."'>";
$mailimg = "<input class='center' type='image' src='images/mailto.png' alt='"._("Mail")."'
name='user_edit_%KEY%-mailAccount' title='"._("Edit mail properties")."'>";
- $fonimg = "<input class='center' type='image' src='images/%image%' alt='"._("Phone")."'
+ $fonimg = "<input class='center' type='image' src='%image%' alt='"._("Phone")."'
name='user_edit_%KEY%-phoneAccount' title='"._("Edit phone properties")."%title%'>";
- $faximg = "<input class='center' type='image' src='images/fax_small.png' alt='"._("Fax")."'
+ $faximg = "<input class='center' type='image' src='plugins/users/images/fax_small.png' alt='"._("Fax")."'
name='user_edit_%KEY%-gofaxAccount' title='"._("Edit fax properies")."'>";
- $sambaimg = "<input class='center' type='image' src='images/select_winstation.png' alt='"._("Samba")."'
+ $sambaimg = "<input class='center' type='image' src='plugins/systems/images/select_winstation.png' alt='"._("Samba")."'
name='user_edit_%KEY%-sambaAccount' title='"._("Edit samba properties")."'>";
- $netatalkimg = "<input class='center' type='image' src='images/select_netatalk.png' alt='"._("Netatalk")."'
+ $netatalkimg = "<input class='center' type='image' src='plugins/netatalk/images/select_netatalk.png' alt='"._("Netatalk")."'
name='user_edit_%KEY%-netatalk' title='"._("Edit netatalk properties")."'>";
- $tplcreateuserimg = "<input type='image' class='center' src='images/list_new.png' alt='"._("Create user from template")."'
+ $tplcreateuserimg = "<input type='image' class='center' src='images/lists/new.png' alt='"._("Create user from template")."'
name='userfrom_tpl_%KEY%' title='"._("Create user with this template")."'>";
/********************
$action= "";
/* Add copy & cut icons */
- $acl_all = $ui->has_complete_category_acls($this->selectedBase,"users") ;
$acl = $ui->get_permissions($val['dn'],"users/user");
- if(preg_match("/(c.*w|w.*c)/",$acl_all) && $this->parent->CopyPasteHandler){
- $action .= "<input class='center' type='image'
- src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
- $action.= "<input class='center' type='image'
- src='images/editcopy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
- }
+
+ /* Add copy & cut functionality */
+ $action.= $this->parent->get_copypaste_action($val['dn'],"users","user");
/* Add deactivate status */
$lock_status = "";
if(isset($val['userPassword'][0]) && preg_match("/^\{[^\}]/",$val['userPassword'][0])){
if(preg_match("/^[^\}]*+\}!/",$val['userPassword'][0])){
- $lock_status = "<input class='center' type='image' src='images/closedlock.png'
+ $lock_status = "<input class='center' type='image' src='images/lists/locked.png'
alt='"._("inactive")."' name='toggle_lock_status_%KEY%'>";
}else{
- $lock_status = "<input class='center' type='image' src='images/openlock.png'
+ $lock_status = "<input class='center' type='image' src='images/lists/unlocked.png'
alt='"._("active")."' name='toggle_lock_status_%KEY%'>";
}
}else{
}
/* Generate edit icon */
- $action.= "<input class='center' type='image' src='images/edit.png' alt='"._("edit")."'
+ $action.= "<input class='center' type='image' src='images/lists/edit.png' alt='"._("edit")."'
name='user_edit_%KEY%' title='".msgPool::editButton(_("user"))."'>";
/* Add deactivate status if we are allowed to */
- if (preg_match("/w/",$acl_all)){
+ if (preg_match("/w/",$ui->get_permissions($val['dn'],"users/password"))){
$action.= $lock_status;
+ }else{
+ $action.="<img src='images/empty.png' alt=' ' class='center'>";
}
/* Add Password change icon, if we are able to write users/password */
if(!in_array_ics("gosaUserTemplate",$val['objectClass']) && preg_match("/w/",$ui->get_permissions($val['dn'],"users/password"))) {
- $action.= "<input class='center' type='image' src='images/list_password.png' alt='"._("password")."'
+ $action.= "<input class='center' type='image' src='plugins/users/images/list_password.png' alt='"._("password")."'
name='user_chgpw_%KEY%' title='"._("Change password")."'>";
}else{
$action.= "<img class='center' src='images/empty.png' alt=' '
title='"._("Not allowed")."'>";
}
- /* Add snapshot icon */
- if(preg_match("/(c.*w|w.*c)/",$acl_all)){
- $action.= $this->GetSnapShotActions($val['dn']);
- }
+ /* Add snapshot functionality */
+ $action.= $this->parent->get_snapshot_action($val['dn'],$this->module);
/* Add remove icon, if we are allowed to remove the current user */
- if(preg_match("/d/",$ui->get_permissions($val['dn'],"users/user"))) {
- $action.= "<input class='center' type='image' src='images/edittrash.png' alt='"._("delete")."'
+ if(preg_match("/d/",$acl)) {
+ $action.= "<input class='center' type='image' src='images/lists/trash.png' alt='"._("delete")."'
name='user_del_%KEY%' title='"._("Delete user")."'>";
}else{
$action.= "<img class='center' src='images/empty.png' alt=' '
}
/* Create phonaccopunt informationm, if conencted && is phoneAccount */
- if((in_array("goFonAccount" ,$val['objectClass']))){
+ if(class_available("phoneAccount") && (in_array("goFonAccount" ,$val['objectClass']))){
/* Set defaults */
- $fonac = preg_replace("/%image%/", "select_phone.png", $fonimg);
+ $fonac = preg_replace("/%image%/", "plugins/gofon/images/select_phone.png", $fonimg);
$fonac = preg_replace("/%KEY%/", "$key", $fonac);
$fonac = preg_replace("/%title%/", "", $fonac);
$field0 = array("string" => "<input type='checkbox' id='item_selected_".$key."' name='item_selected_".$key."'>" ,
"attach" => "style='width:20px;'");
$field1 = array("string" => sprintf($tpl,$val['dn']), "attach" => "style='text-align:center;width:20px;'");
- $field2 = array("string" => sprintf($editlink,$key,$display), "attach" => "style='' title='".preg_replace('/ /', ' ', @LDAP::fix($val['dn']))."'");
+ $field2 = array("string" => sprintf($editlink,$key,$display), "attach" => "style='' title='".preg_replace('/ /', ' ', LDAP::fix($val['dn']))."'");
$field3 = array("string" => $UseImg, "attach" => "style='width:166px;'");
$field4 = array("string" => $s_img_create_from_template.preg_replace("/%KEY%/", "$key", $action),
"attach" => "style='width:".$action_col_size."px;border-right:0px; text-align:right;'");
$num_user_str = _("Number of listed users");
$num_dep_str = _("Number of listed departments");
- $str = "<img class='center' src='images/select_user.png'
+ $str = "<img class='center' src='plugins/users/images/select_user.png'
title='".$num_user_str."' alt='".$num_user_str."'> ".$num_users." ";
- $str.= "<img class='center' src='images/folder.png'
+ $str.= "<img class='center' src='images/lists/folder.png'
title='".$num_dep_str."' alt='".$num_dep_str."'> ".$num_deps." ";
$this->set_List_Bottom_Info($str);