Changeset 5133 for trunk/expressoAdmin1_2/inc/class.bosectors.inc.php
- Timestamp:
- 11/03/11 13:24:14 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoAdmin1_2/inc/class.bosectors.inc.php
r3915 r5133 48 48 $sector_info['objectClass'][1] = 'organizationalUnit'; 49 49 50 if( isset($_POST['associated_domain']) )51 {52 if ( $_POST['associated_domain'] != "") {53 $sector_info['objectClass'][2] = 'domainRelatedObject';54 $sector_info['associatedDomain'] = trim($_POST['associated_domain']);55 }56 }57 58 50 $systemName = $GLOBALS['phpgw_info']['server']['system_name']; 59 51 if ($systemName != '') … … 66 58 } 67 59 68 69 /*70 Insere as informações sobre quota total por usuários e por gigabytes de espaço em disco71 Se não vierem os dados, ele coloca 0 (Caso não exista controle de cota).72 */73 74 $controlled_by_quota = false;75 76 if( isset($_POST['disk_quota']) )77 {78 $controlled_by_quota = true;79 $sector_info['diskQuota'] = (trim($_POST['disk_quota']) != "") ? $_POST['disk_quota'] : "0";80 }81 82 if( isset($_POST['users_quota']) )83 {84 $controlled_by_quota = true;85 $sector_info['usersQuota'] = (trim($_POST['users_quota']) != "") ? $_POST['users_quota'] : "0";86 }87 88 if( isset($_POST['file_manager_quota']) )89 {90 $controlled_by_quota = true;91 $sector_info['fileManagerQuota'] = (trim($_POST['file_manager_quota']) != "") ? $_POST['file_manager_quota'] : "0";92 }93 94 if($controlled_by_quota)95 $sector_info['objectClass'][] = 'phpgwQuotaControlled';96 97 60 // Chama funcao para escrever no OpenLDAP, case de erro, volta com msg de erro. 98 61 if (!$this->so->write_ldap($dn, $sector_info)) … … 103 66 } 104 67 105 // 68 //Escreve no log 106 69 $this->db_functions->write_log("created sector", "$dn"); 107 70 … … 113 76 function save_sector() 114 77 { 115 $sector_info = $this->so->get_info($_POST['context']); 78 $context = utf8_encode($_POST['context']); 79 80 $sector_info = $this->so->get_info($context); 116 81 117 if (($_POST['sector_visible'] == 'on') && ($sector_info[ 0]['phpgwaccountvisible'][0] != '-1'))82 if (($_POST['sector_visible'] == 'on') && ($sector_info['phpgwaccountvisible'] != '-1')) 118 83 { 119 $phpgwAccount = $controlled_by_quota = false;120 84 foreach ($sector_info[0]['objectclass'] as $objectClass) 121 85 { 122 86 if ($objectClass == 'phpgwAccount') 123 87 $phpgwAccount = true; 124 if ($objectClass == 'phpgwquotacontrolled')125 $ controlled_by_quota = true;88 else 89 $phpgwAccount = false; 126 90 } 127 91 … … 134 98 $this->so->add_attribute($sector_info[0]['dn'], $ldap_mod_add); 135 99 } 136 else if($sector_info[0]['phpgwaccountvisible'][0] == '-1')100 else 137 101 { 138 102 $ldap_mod_del['objectClass'] = 'phpgwAccount'; … … 141 105 } 142 106 143 //Modifica o conteúdo das cotas.144 if( (isset($_POST['disk_quota']) )145 || (isset($_POST['users_quota']) )146 || (isset($_POST['file_manager_quota']) )) { //se for passado alguma coisa, lógico147 148 $file_manager_space = $this->functions->get_actual_disk_usage($_POST["context"],'FileManager');149 if($_POST["file_manager_quota"]<$file_manager_space){150 $_POST['error_messages'] = lang("Theres more disk space in use than the quota. It needs to be more than %1 MB",$file_manager_space);151 $_GET['context'] = $_POST["context"];152 ExecMethod('expressoAdmin1_2.uisectors.edit_sector');153 return false;154 }155 156 if(!$controlled_by_quota) {157 $ldap_mod_add['objectClass'][] = 'phpgwQuotaControlled';158 $this->so->add_attribute($sector_info[0]['dn'], $ldap_mod_add);159 }160 161 $ldap_mod_replace = array();162 $ldap_mod_replace['diskQuota'] = $_POST['disk_quota'];163 $ldap_mod_replace['usersQuota'] = $_POST['users_quota'];164 $ldap_mod_replace['fileManagerQuota'] = $_POST['file_manager_quota'];165 $this->so->replace_attribute($sector_info[0]['dn'], $ldap_mod_replace);166 }167 168 107 // Volta para o ListSectors 169 108 ExecMethod('expressoAdmin1_2.uisectors.list_sectors'); … … 184 123 $manager_context = $_POST['manager_context']; 185 124 186 125 $sector_dn = utf8_encode($sector_dn); 187 126 188 127 $sector_users = $this->so->get_sector_users($sector_dn); 128 189 129 for ($i=0; $i<count($sector_users)-1; $i++) 190 130 {
Note: See TracChangeset
for help on using the changeset viewer.