summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 27a10bc)
raw | patch | inline | side by side (parent: 27a10bc)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 25 Jan 2010 10:50:27 +0000 (10:50 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 25 Jan 2010 10:50:27 +0000 (10:50 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15277 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/systems/admin/systems/class_serverService.inc | patch | blob | history |
diff --git a/gosa-plugins/systems/admin/systems/class_serverService.inc b/gosa-plugins/systems/admin/systems/class_serverService.inc
index febc1cdc5ae293d13edd0402abb9b80b654b00f4..72fb365f132c7b9182d2ffe9b14b9f90f363bf14 100644 (file)
$this->attrs = $this->parent->attrs;
}
-
// Set storage points - We do not have any - We just create a fake list which lists all services
$this->storagePoints = array();
-# // Build filter
-# if (session::global_is_set(get_class($this)."_filter")){
-# $filter= session::global_get(get_class($this)."_filter");
-# } else {
- $filter = new filter(get_template_path("serverService-filter.xml", true));
- $filter->setObjectStorage($this->storagePoints);
-#}
- $this->setFilter($filter);
+ // Build filter
+ if (session::global_is_set(get_class($this)."_filter")){
+ $filter= session::global_get(get_class($this)."_filter");
+ } else {
+ $filter = new filter(get_template_path("serverService-filter.xml", true));
+ $filter->setObjectStorage($this->storagePoints);
+ }
+ $this->setFilter($filter);
- // Build headpage
- $headpage = new listing(get_template_path("serverService-list.xml", true));
- $headpage->registerElementFilter("filterServiceStatus", "ServerService::filterServiceStatus");
- $headpage->setFilter($filter);
+ // Build headpage
+ $headpage = new listing(get_template_path("serverService-list.xml", true));
+ $headpage->registerElementFilter("filterServiceStatus", "ServerService::filterServiceStatus");
+ $headpage->setFilter($filter);
- // Initialize list of used and useable services.
- foreach ($config->data['TABS']['SERVERSERVICE'] as $plug){
- if(class_available($plug['CLASS'])){
+ // Initialize list of used and useable services.
+ foreach ($config->data['TABS']['SERVERSERVICE'] as $plug){
+ if(class_available($plug['CLASS'])){
- $name= $plug['CLASS'];
- $this->plugin_names[]= $name;
- $this->plugins[$name]= new $name($config, $dn, $this);
+ $name= $plug['CLASS'];
+ $this->plugin_names[]= $name;
+ $this->plugins[$name]= new $name($config, $dn, $this);
- /* Initialize kerberos key support */
- if(isset($this->plugins[$name]->krb_service_prefix) && !empty($this->plugins[$name]->krb_service_prefix)){
- $this->plugins[$name]->krb_host_key = &$this->parent->kerberos_key_service;
- }
+ /* Initialize kerberos key support */
+ if(isset($this->plugins[$name]->krb_service_prefix) && !empty($this->plugins[$name]->krb_service_prefix)){
+ $this->plugins[$name]->krb_host_key = &$this->parent->kerberos_key_service;
+ }
- /* Capture all service objectClases, necessary for acl handling */
- if(isset($this->plugins[$name]->objectclasses)){
- foreach($this->plugins[$name]->objectclasses as $oc){
- $this->objectclasses[] = $oc;
+ /* Capture all service objectClases, necessary for acl handling */
+ if(isset($this->plugins[$name]->objectclasses)){
+ foreach($this->plugins[$name]->objectclasses as $oc){
+ $this->objectclasses[] = $oc;
+ }
}
}
- }else{
-#trigger_error("Service class missing: ".$plug['CLASS']);
}
- }
- parent::__construct($config, $this->ui, "services", $headpage);
- $this->registerAction("new", "newService");
- $this->registerAction("remove", "removeService");
- $this->registerAction("newServiceSelected", "newServiceSelected");
- $this->registerAction("saveService", "saveService");
- $this->registerAction("cancelService", "cancelEdit");
- $this->registerAction("newServiceCancel", "closeDialogs");
- $this->registerAction("restart", "updateServiceStatus");
- $this->registerAction("stop", "updateServiceStatus");
- $this->registerAction("start", "updateServiceStatus");
+ parent::__construct($config, $this->ui, "services", $headpage);
+ $this->registerAction("new", "newService");
+ $this->registerAction("remove", "removeService");
+ $this->registerAction("newServiceSelected", "newServiceSelected");
+ $this->registerAction("saveService", "saveService");
+ $this->registerAction("cancelService", "cancelEdit");
+ $this->registerAction("newServiceCancel", "closeDialogs");
+ $this->registerAction("restart", "updateServiceStatus");
+ $this->registerAction("stop", "updateServiceStatus");
+ $this->registerAction("start", "updateServiceStatus");
}
+
+ /*! \brief Filter extra POST and GET variables for this plugin.
+ */
function detectPostActions()
{
$action = management::detectPostActions();
return($action);
}
+
+ /*! \brief Edit an existing service here.
+ * Somebody clicked on the paper and pencil icon.
+ */
function editEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="")
{
$this->dialog = TRUE;
}
}
+
/*! \brief Editing an object was caneled.
* Close dialogs/tabs and remove locks.
*/
}
+ /*! \brief Let the user choose the new service to create.
+ */
function newService()
{
$this->dialog = TRUE;
$this->dialogObject = new ServiceAddDialog($this->config,$this->dn,$this);
}
+
+ /*! \brief Create the selected service.
+ */
+ function newServiceSelected()
+ {
+ $this->closeDialogs();
+ $serv = $_POST['ServiceName'];
+ $this->plugins[$serv]->is_account = true;
+ $this->dialogObject = $this->plugins[$serv];
+ $this->current = $serv;
+ $this->dialog = TRUE;
+ }
+
+
+ /*! \brief Save the currently edited service.
+ */
function saveService()
{
$this->dialogObject->save_object();
}
}
- function newServiceSelected()
- {
- $this->closeDialogs();
- $serv = $_POST['ServiceName'];
- $this->plugins[$serv]->is_account = true;
- $this->dialogObject = $this->plugins[$serv];
- $this->current = $serv;
- $this->dialog = TRUE;
- }
-
+ /*!\brief Close all opened dialogs
+ * And reset "dialog open" flags to display bottom buttons again.
+ */
function closeDialogs()
{
management::closeDialogs();
$this->dialog = FALSE;
}
+
+ /*! \brief Remove the selected service(s)
+ */
protected function removeService($action="",$target=array(),$all=array())
{
foreach($target as $s_entry){
}
}
+
+ /*! \brief Returns the list of of services, active services.
+ * Used in the filter class for services.
+ * class_filterServerService.inc
+ */
static function getServiceList()
{
return(session::get('ServerService'));
}
+
+ /*! \brief Returns an image for the service status.
+ * Used in the service list class.
+ */
static function filterServiceStatus($a,$b,$c,$d)
{
$img ="";
return($this->renderList());
}
+
+ /*! \brief Updates the status for a list of services.
+ */
function updateServiceStatus($action, $target,$all)
{
/* Handle state changes for services */
}
}
- function _execute()
- {
-
- /* Dispaly services overview */
- session::set('ServerService', $this->plugins);
- return(management::execute());
- }
-
-
- /* Get all used services
- CLASSNAME => _($this->plugins[*]->DisplayName); */
+ /*! \brief Returns a list of all used services
+ * CLASSNAME => _($this->plugins[*]->DisplayName);
+ */
function getAllUsedServices()
{
$ret = array();
}
- /* Get all unused services
- CLASSNAME => _($this->plugins[*]->DisplayName); */
+ /*! \brief Returns a list of all unused services.
+ */
function getAllUnusedServices()
{
$tmp = $this->getAllUsedServices();
}
- /* This function sets the status var for each used
- service && calls an external hook if specified in gosa.conf*/
+ /*! \brief Updates the status of a service and
+ * calls an external hook if specified in gosa.conf
+ */
function ServiceStatusUpdate($method , $service)
{
/* Skip if this is a new server */
}
+ /*! \brief No checks here.
+ */
function check()
{
return(array());
}
+ /*! \brief Keep posted form values in opened dialogs
+ */
function save_object()
{
foreach($this->plugins as $name => $obj){
}
+ /*! \brief Remove all active services
+ */
function remove_from_parent()
{
$caseVars = array("cn","dn");
}
+ /*! \brief Save all active services
+ */
function save()
{
$caseVars = array("cn","dn");
}
+ /*! \brief Prepare active services to be copied.
+ */
function PrepareForCopyPaste($source)
{
plugin::PrepareForCopyPaste($source);
}
- /* Check if all plugins allow a remove .. */
+ /*! \brief Check if there is an active service which prevents
+ * complete service removal.
+ */
function allow_remove()
{
foreach($this->plugins as $name => $obj){
}
- // Forward plugin ACLs
+ /*! \brief Forward plugin acls
+ */
function set_acl_base($base)
{
$this->acl_base = $base;
}
}
- // Forward plugin ACLs
+
+ /*! \brief Forward plugin acls
+ */
function set_acl_category($category)
{
$this->acl_category = $category;