75 lines
1.6 KiB
PHP
75 lines
1.6 KiB
PHP
<?php
|
|
|
|
/** User Container
|
|
*
|
|
* @version 1.9.1
|
|
* @since 2007-05-01
|
|
* @author martin lenzelbauer
|
|
*
|
|
*
|
|
* @change 2007-06-18
|
|
* changed install() due to changes in Container
|
|
*/
|
|
class UserContainer extends Container{
|
|
|
|
|
|
/** C'tor
|
|
*/
|
|
//-----------------------------------------------
|
|
function UserContainer($id=0, $parent=NULL){
|
|
//-----------------------------------------------
|
|
parent::Container($id, $parent);
|
|
$this->name = "Benutzer";
|
|
$this->objectsClass = "User";
|
|
$this->allowedChildObjects = array("user");
|
|
$this->listable = USER_ADMIN;
|
|
$this->editable = USER_ADMIN;
|
|
}
|
|
|
|
|
|
/** @see Container::install()
|
|
*/
|
|
//----------------------------------------------
|
|
function install(){
|
|
//----------------------------------------------
|
|
parent::install();
|
|
}
|
|
|
|
|
|
/** @see Element::getCssClass()
|
|
*/
|
|
//-----------------------------------------------
|
|
function getCssClass(){
|
|
//-----------------------------------------------
|
|
return "itemUsers";
|
|
}
|
|
|
|
|
|
// === ADDITIONAL METHODS =============================================== //
|
|
|
|
|
|
/** returns the flexicon id of the given user
|
|
* @param user login of the user
|
|
* @return id
|
|
*/
|
|
//-----------------------------------------------
|
|
function getUserId($user){
|
|
//-----------------------------------------------
|
|
if(sizeof($this->childObjects) == 0){
|
|
$this->load();
|
|
}
|
|
foreach($this->childObjects as $i=>$child){
|
|
$child = clone($child);
|
|
$child->load();
|
|
if($child->getLogin() == $user){
|
|
return $child->getId();
|
|
}
|
|
}
|
|
logError(2, "Given user cannot be found: $user", __FILE__, __LINE__);
|
|
return -1;
|
|
}
|
|
|
|
};
|
|
|
|
|
|
?>
|