
Öffentliche Methoden | |
| GroupAction () | |
| delete () | |
| remove () | |
| save () | |
| add () | |
| addgroup () | |
| adduser () | |
| addusertogroup () | |
| deluser () | |
| listing () | |
| edit () | |
| memberships () | |
| users () | |
| rights () | |
| checkMenu ($menu) | |
Öffentliche Attribute | |
| $group | |
| $defaultSubAction = 'edit' | |
Definiert in Zeile 32 der Datei GroupAction.class.php.
| GroupAction::add | ( | ) |
| GroupAction::addgroup | ( | ) |
Definiert in Zeile 99 der Datei GroupAction.class.php.
Benutzt Action::addNotice(), Action::addValidationError(), Action::callSubAction() und Action::getRequestVar().
00100 { 00101 if ( $this->getRequestVar('name') != '') 00102 { 00103 $this->group = new Group(); 00104 $this->group->name = $this->getRequestVar('name'); 00105 $this->group->add(); 00106 $this->addNotice('group',$this->group->name,'ADDED','ok'); 00107 $this->callSubAction('listing'); 00108 } 00109 else 00110 { 00111 $this->addValidationError('name'); 00112 $this->callSubAction('add'); 00113 } 00114 }
| GroupAction::adduser | ( | ) |
Definiert in Zeile 117 der Datei GroupAction.class.php.
Benutzt Action::setTemplateVar().
00118 { 00119 $this->setTemplateVar('users',$this->group->getOtherUsers()); 00120 }
| GroupAction::addusertogroup | ( | ) |
Benutzer zur Gruppe hinzuf�gen.
Es kann eine Liste oder eine einzelne Person zur Gruppe hinzugef�gt werden.
Definiert in Zeile 127 der Datei GroupAction.class.php.
Benutzt Action::addNotice() und Action::getRequestVar().
00128 { 00129 $userid = $this->getRequestVar('userid'); 00130 00131 if ( is_array($userid)) 00132 { 00133 // Im Request steht eine Liste von User-Ids. 00134 foreach( $userid as $uid ) 00135 { 00136 $this->group->addUser( $uid ); 00137 } 00138 $this->addNotice('group',$this->group->name,'USER_ADDED_TO_GROUP',OR_NOTICE_OK,array('count'=>count($userid))); 00139 } 00140 elseif( intval($userid) > 0 ) 00141 { 00142 // Nur 1 Benutzer hinzuf�gen. 00143 $this->group->addUser( intval($userid) ); 00144 $this->addNotice('group',$this->group->name,'USER_ADDED_TO_GROUP',OK_NOTICE_OK,array('count'=>'1')); 00145 } 00146 else 00147 { 00148 // Es wurde kein Benutzer ausgew�hlt. 00149 $this->addNotice('group',$this->group->name,'NOTHING_DONE',OR_NOTICE_WARN); 00150 } 00151 }
| GroupAction::checkMenu | ( | $ | menu | ) |
Men�.
| String | $menu Men�eintrag. |
Erneute Implementation von Action.
Definiert in Zeile 292 der Datei GroupAction.class.php.
00293 { 00294 switch( $menu ) 00295 { 00296 case 'users': 00297 // Benutzerliste nur anzeigen, wenn welche vorhanden. 00298 return count($this->group->getUsers()) > 0; 00299 case 'adduser': 00300 // Benutzer k�nnen nur hinzugef�gt werden, wenn noch nicht alle 00301 // in der Gruppe sind. 00302 return count($this->group->getOtherUsers()) > 0; 00303 default: 00304 return true; 00305 } 00306 }
| GroupAction::delete | ( | ) |
Definiert in Zeile 53 der Datei GroupAction.class.php.
Benutzt Action::addNotice() und Action::hasRequestVar().
00054 { 00055 if ( $this->hasRequestVar('confirm') ) 00056 { 00057 $this->group->delete(); 00058 00059 $this->addNotice('group',$this->group->name,'DELETED','ok'); 00060 } 00061 else 00062 { 00063 $this->addNotice('group',$this->group->name,'NOT_DELETED','ok'); 00064 } 00065 }
| GroupAction::deluser | ( | ) |
Einen Benutzer aus der Gruppe entfernen.
Definiert in Zeile 158 der Datei GroupAction.class.php.
Benutzt Action::addNotice() und Action::getRequestVar().
00159 { 00160 $this->group->delUser( intval($this->getRequestVar('userid')) ); 00161 00162 $this->addNotice('group',$this->group->name,'DELETED',OR_NOTICE_OK); 00163 }
| GroupAction::edit | ( | ) |
Definiert in Zeile 185 der Datei GroupAction.class.php.
Benutzt Action::setTemplateVars().
00186 { 00187 $this->setTemplateVars( $this->group->getProperties() ); 00188 }
| GroupAction::GroupAction | ( | ) |
Definiert in Zeile 38 der Datei GroupAction.class.php.
Benutzt Action::getRequestId(), Action::setTemplateVar() und Action::userIsAdmin().
00039 { 00040 if ( !$this->userIsAdmin() ) 00041 die('you are not an admin'); 00042 00043 if ( $this->getRequestId() != 0 ) 00044 { 00045 $this->group = new Group( $this->getRequestId() ); 00046 $this->group->load(); 00047 $this->setTemplateVar( 'groupid',$this->group->groupid ); 00048 } 00049 }
| GroupAction::listing | ( | ) |
Liste aller Gruppen.
Definiert in Zeile 170 der Datei GroupAction.class.php.
Benutzt Group::getAll(), Action::setTemplateVar() und Html::url().
00171 { 00172 $list = array(); 00173 00174 foreach( Group::getAll() as $id=>$name ) 00175 { 00176 $list[$id] = array(); 00177 $list[$id]['url' ] = Html::url('main','group',$id,array(REQ_PARAM_TARGETSUBACTION=>'edit')); 00178 $list[$id]['name'] = $name; 00179 } 00180 00181 $this->setTemplateVar('el', $list); 00182 }
| GroupAction::memberships | ( | ) |
| GroupAction::remove | ( | ) |
Definiert in Zeile 69 der Datei GroupAction.class.php.
Benutzt Action::setTemplateVars().
00070 { 00071 $this->setTemplateVars( $this->group->getProperties() ); 00072 }
| GroupAction::rights | ( | ) |
Anzeigen der Benutzerrechte
Definiert in Zeile 226 der Datei GroupAction.class.php.
Benutzt $group, Acl::getAvailableRights(), lang() und Action::setTemplateVar().
00227 { 00228 $rights = $this->group->getAllAcls(); 00229 00230 $projects = array(); 00231 00232 foreach( $rights as $acl ) 00233 { 00234 if ( !isset($projects[$acl->projectid])) 00235 { 00236 $projects[$acl->projectid] = array(); 00237 $p = new Project($acl->projectid); 00238 $p->load(); 00239 $projects[$acl->projectid]['projectname'] = $p->name; 00240 $projects[$acl->projectid]['rights' ] = array(); 00241 } 00242 00243 $right = array(); 00244 00245 if ( $acl->languageid > 0 ) 00246 { 00247 $language = new Language($acl->languageid); 00248 $language->load(); 00249 $right['languagename'] = $language->name; 00250 } 00251 else 00252 { 00253 $right['languagename'] = lang('ALL_LANGUAGES'); 00254 } 00255 00256 00257 $o = new Object($acl->objectid); 00258 $o->objectLoad(); 00259 $right['objectname'] = $o->name; 00260 $right['objectid' ] = $o->objectid; 00261 $right['objecttype'] = $o->getType(); 00262 00263 if ( $acl->groupid > 0 ) 00264 { 00265 $group = new Group($acl->groupid); 00266 $group->load(); 00267 $right['groupname'] = $group->name; 00268 } 00269 else 00270 { 00271 // Berechtigung f�r "alle". 00272 } 00273 00274 $right['bits'] = $acl->getProperties(); 00275 00276 $projects[$acl->projectid]['rights'][] = $right; 00277 } 00278 00279 $this->setTemplateVar('projects' ,$projects ); 00280 00281 $this->setTemplateVar('show',Acl::getAvailableRights() ); 00282 }
| GroupAction::save | ( | ) |
Definiert in Zeile 76 der Datei GroupAction.class.php.
Benutzt Action::addNotice(), Action::addValidationError(), Action::callSubAction() und Action::getRequestVar().
00077 { 00078 if ( $this->getRequestVar('name') != '' ) 00079 { 00080 $this->group->name = $this->getRequestVar('name'); 00081 00082 $this->group->save(); 00083 00084 $this->addNotice('group',$this->group->name,'SAVED','ok'); 00085 } 00086 else 00087 { 00088 $this->addValidationError('name'); 00089 $this->callSubAction('edit'); 00090 } 00091 }
| GroupAction::users | ( | ) |
Liste aller Benutzer in dieser Gruppe.
Definiert in Zeile 205 der Datei GroupAction.class.php.
Benutzt Action::getRequestId(), Action::setTemplateVar() und Html::url().
00206 { 00207 // Mitgliedschaften ermitteln 00208 // 00209 $userliste = array(); 00210 00211 foreach( $this->group->getUsers() as $userid=>$name ) 00212 { 00213 $userliste[$userid] = array('name' => $name, 00214 'delete_url' => Html::url('group','deluser',$this->getRequestId(),array('userid'=>$userid))); 00215 } 00216 $this->setTemplateVar('memberships',$userliste); 00217 }
| GroupAction::$defaultSubAction = 'edit' |
Definiert in Zeile 35 der Datei GroupAction.class.php.
| GroupAction::$group |
1.5.8