예제 #1
0
 public static function getForbiddenTypesNameFromGroup($groupname)
 {
     $db = DBManager::get();
     $data = array();
     $typeID = DocFileTypeForbidden::findBySQL('usergroup = ' . $db->quote($groupname));
     foreach ($typeID as $id) {
         $data[] = array_pop(DocFiletype::findById($id['dateityp_id']));
     }
     return $data;
 }
예제 #2
0
 public function edit_action($config_id = 0, $isGroupConfig = false)
 {
     $this->types = DocFiletype::findBySQL('id IS NOT NULL ORDER BY type'); 
     //Existing entry     
     if($config_id != 0){
         $this->config_id = $config_id;
         $this->config = DocUsergroupConfig::getConfig($config_id);
         if($this->config != false){
             if($this->config['isGroupConfig'] == 1){
                 $this->isGroupConfig == 'true';
             }else{
                 $this->isGroupConfig == 'false';
             }
             $this->isGroupConfig == '';
             $this->config['upload_quota']= $this->sizeInUnit($this->config['upload_quota'], $this->config['upload_unit']);
             $this->config['quota']= $this->sizeInUnit($this->config['quota'], $this->config['quota_unit']);
             if(Request::isXhr()){
                 header('X-Title: ' . _('Persönlichen Dateibereich für ' . $this->config['name'] . ' konfigurieren'));
             }else{
                 $this->head = 'Persönlichen Dateibereich für ' . $this->config['name'] . ' konfigurieren';
             }
         }else{
             PageLayout::postMessage(MessageBox::error(_('Einstellung konnten nicht gefunden werden.')));
             $this->redirect('document/administration/filter');
         }
     //New Entry
     }else{
         //Configuration Entry for a group
         $this->config_id = 0;
         if($isGroupConfig == 'true'){
             $this->config['types'] = array();
             $this->isGroupConfig = $isGroupConfig;
             $groupConfigs = DocUsergroupConfig::getGroupConfigAll(1);
             $groups = array("default" => "default", "user" =>"user", "autor" => "autor",
                         "tutor" => "tutor", "dozent" => "dozent", "admin" => "admin",
                         "root" => "root");
             foreach($groups as $group){
                 foreach($groupConfigs as $config){
                     if($config['name'] == $group){
                         unset($groups[$config['name']]);
                     }
                 }
             }
             $this->groups = $groups;
             if (Request::isXhr()) {
                 header('X-Title: ' . _('Neue Gruppeneinstellung für den Persönlichen Dateibereich erstellen'));
             } else {
                 $this->head = 'Neue Gruppeneinstellung für den Persönlichen Dateibereich erstellen';
             }
         //Configuration Entry for a User    
         }
         if($isGroupConfig != 'true' && $isGroupConfig != 'false'){
             $user = new User($isGroupConfig);
             $groupConfigs = DocUsergroupConfig::getGroupConfigAll(1);
             $this->config['types'] = array();
             $this->isGroupConfig = false;
             $this->user_id = $isGroupConfig;
             if (Request::isXhr()) {
                 header('X-Title: ' . _('Neue Einstellung für '.$user->getFullName()));
             } else {
                 $this->head = 'Neue Einstellung für '.$user->getFullName();
             }
         }
     }
 }