
Öffentliche Methoden | |
| addacl () | |
| rights () | |
| inherit () | |
| aclform () | |
| delacl () | |
Öffentliche Attribute | |
| $objectid | |
Definiert in Zeile 96 der Datei ObjectAction.class.php.
| ObjectAction::aclform | ( | ) |
Formular anzeigen, um Rechte hinzufuegen
Definiert in Zeile 280 der Datei ObjectAction.class.php.
Benutzt actionName, Language::getAll(), Group::getAll(), Session::getObject(), lang(), User::listAll(), Action::setTemplateVar() und Action::setTemplateVars().
00281 { 00282 $o = Session::getObject(); 00283 $o->objectLoadRaw(); 00284 00285 $this->setTemplateVars( $o->getAssocRelatedAclTypes() ); 00286 $this->setTemplateVar( 'show',$o->getRelatedAclTypes() ); 00287 00288 $this->setTemplateVar('users' ,User::listAll() ); 00289 $this->setTemplateVar('groups' ,Group::getAll() ); 00290 00291 $languages = array(0=>lang('GLOBAL_ALL_LANGUAGES')); 00292 $languages += Language::getAll(); 00293 $this->setTemplateVar('languages',$languages ); 00294 $this->setTemplateVar('objectid' ,$o->objectid ); 00295 $this->setTemplateVar('action' ,$this->actionName); 00296 }
| ObjectAction::addacl | ( | ) |
ACL zu einem Objekt setzen
public
Definiert in Zeile 106 der Datei ObjectAction.class.php.
Benutzt Action::addNotice(), Action::addValidationError(), Action::callSubAction(), Action::getRequestId(), Action::getRequestVar() und Action::hasRequestVar().
00107 { 00108 $acl = new Acl(); 00109 00110 $acl->objectid = $this->getRequestId(); 00111 00112 // Nachschauen, ob der Benutzer ueberhaupt berechtigt ist, an 00113 // diesem Objekt die ACLs zu aendern. 00114 $o = new Object( $acl->objectid ); 00115 00116 if ( !$o->hasRight( ACL_GRANT ) ) 00117 die('uh?'); // Scheiss Hacker. 00118 00119 // Handelt es sich um eine Benutzer- oder Gruppen ACL? 00120 switch( $this->getRequestVar('type') ) 00121 { 00122 case 'user': 00123 $acl->userid = $this->getRequestVar('userid' ); 00124 00125 if ( $acl->userid <= 0 ) 00126 { 00127 $this->addValidationError('type' ); 00128 $this->addValidationError('userid',''); 00129 $this->callSubAction('aclform'); 00130 return; 00131 } 00132 break; 00133 case 'group': 00134 $acl->groupid = $this->getRequestVar('groupid'); 00135 if ( $acl->groupid <= 0 ) 00136 { 00137 $this->addValidationError('type' ); 00138 $this->addValidationError('groupid',''); 00139 $this->callSubAction('aclform'); 00140 return; 00141 } 00142 break; 00143 case 'all': 00144 break; 00145 default: 00146 $this->addValidationError('type'); 00147 $this->callSubAction('aclform'); 00148 return; 00149 } 00150 00151 $acl->languageid = $this->getRequestVar(REQ_PARAM_LANGUAGE_ID); 00152 00153 $acl->write = ( $this->hasRequestVar('write' ) ); 00154 $acl->prop = ( $this->hasRequestVar('prop' ) ); 00155 $acl->delete = ( $this->hasRequestVar('delete' ) ); 00156 $acl->release = ( $this->hasRequestVar('release' ) ); 00157 $acl->publish = ( $this->hasRequestVar('publish' ) ); 00158 $acl->create_folder = ( $this->hasRequestVar('create_folder') ); 00159 $acl->create_file = ( $this->hasRequestVar('create_file' ) ); 00160 $acl->create_link = ( $this->hasRequestVar('create_link' ) ); 00161 $acl->create_page = ( $this->hasRequestVar('create_page' ) ); 00162 $acl->grant = ( $this->hasRequestVar('grant' ) ); 00163 $acl->transmit = ( $this->hasRequestVar('transmit' ) ); 00164 00165 $acl->add(); 00166 00167 $this->addNotice('','','ADDED',OR_NOTICE_OK); 00168 00169 $o->setTimestamp(); 00170 }
| ObjectAction::delacl | ( | ) |
Entfernen einer ACL
protected
Definiert in Zeile 305 der Datei ObjectAction.class.php.
Benutzt Action::addNotice(), Action::getRequestId() und Action::getRequestVar().
00306 { 00307 $acl = new Acl($this->getRequestVar('aclid')); 00308 $acl->objectid = $this->getRequestId(); 00309 00310 // Nachschauen, ob der Benutzer ueberhaupt berechtigt ist, an 00311 // diesem Objekt die ACLs zu aendern. 00312 $o = new Object( $this->getRequestId() ); 00313 00314 if ( !$o->hasRight( ACL_GRANT ) ) 00315 die('ehm?'); // Da wollte uns wohl einer vereimern. 00316 00317 $acl->delete(); // Weg mit der ACL 00318 00319 $this->addNotice('','','DELETED',OR_NOTICE_OK); 00320 }
| ObjectAction::inherit | ( | ) |
Definiert in Zeile 218 der Datei ObjectAction.class.php.
Benutzt Action::addNotice() und Action::hasRequestVar().
00219 { 00220 $log = array(); 00221 00222 if ( ! $this->hasRequestVar('inherit') ) 00223 { 00224 $this->addNotice('folder',$this->name,'NOTHING_DONE',OR_NOTICE_WARN); 00225 return; 00226 } 00227 00228 00229 $folder = $this->folder; 00230 $aclids = $folder->getAllAclIds(); 00231 00232 $newAclList = array(); 00233 foreach( $aclids as $aclid ) 00234 { 00235 $acl = new Acl( $aclid ); 00236 $acl->load(); 00237 if ( $acl->transmit ) 00238 $newAclList[] = $acl; 00239 } 00240 $log[] = 'inheriting '.count($newAclList).' acls'; 00241 00242 $oids = $folder->getObjectIds(); 00243 00244 foreach( $folder->getAllSubfolderIds() as $sfid ) 00245 { 00246 $subfolder = new Folder( $sfid ); 00247 00248 $oids = array_merge($oids,$subfolder->getObjectIds()); 00249 } 00250 00251 foreach( $oids as $oid ) 00252 { 00253 $object = new Object( $oid ); 00254 00255 // Die alten ACLs des Objektes löschen. 00256 foreach( $object->getAllAclIds() as $aclid ) 00257 { 00258 $acl = new Acl( $aclid ); 00259 $acl->objectid = $oid; 00260 $acl->delete(); 00261 $log[] = 'removing acl '.$aclid.' for object '.$oid; 00262 } 00263 00264 // Vererbbare ACLs des aktuellen Ordners anwenden. 00265 foreach( $newAclList as $newAcl ) 00266 { 00267 $newAcl->objectid = $oid; 00268 $newAcl->add(); 00269 $log[] = 'adding new acl '.$newAcl->aclid.' for object '.$oid; 00270 } 00271 } 00272 00273 $this->addNotice('folder',$this->name,'SAVED',OR_NOTICE_OK,array(),$log); 00274 }
| ObjectAction::rights | ( | ) |
Alle Rechte anzeigen
Definiert in Zeile 177 der Datei ObjectAction.class.php.
Benutzt actionName, Session::getObject(), Action::setTemplateVar(), Action::setTemplateVars() und Html::url().
00178 { 00179 // $this->actionName = 'object'; 00180 $o = Session::getObject(); 00181 $o->objectLoadRaw(); 00182 $this->setTemplateVar( 'show',$o->getRelatedAclTypes() ); 00183 $this->setTemplateVar( 'type',$o->getType() ); 00184 00185 $acllist = array(); 00186 00187 /* 00188 foreach( $o->getAllInheritedAclIds() as $aclid ) 00189 { 00190 $acl = new Acl( $aclid ); 00191 $acl->load(); 00192 $key = 'au'.$acl->username.'g'.$acl->groupname.'a'.$aclid; 00193 $acllist[$key] = $acl->getProperties(); 00194 } 00195 */ 00196 00197 foreach( $o->getAllAclIds() as $aclid ) 00198 { 00199 $acl = new Acl( $aclid ); 00200 $acl->load(); 00201 $key = 'bu'.$acl->username.'g'.$acl->groupname.'a'.$aclid; 00202 $acllist[$key] = $acl->getProperties(); 00203 $acllist[$key]['delete_url'] = Html::url($this->actionName,'delacl',$o->objectid,array('aclid'=>$aclid)); 00204 } 00205 ksort( $acllist ); 00206 00207 $this->setTemplateVar('acls',$acllist ); 00208 00209 $this->setTemplateVars( $o->getAssocRelatedAclTypes() ); 00210 }
| ObjectAction::$objectid |
Definiert in Zeile 98 der Datei ObjectAction.class.php.
1.5.8