diff --git a/plugins/admin/systems/class_servRepository.inc b/plugins/admin/systems/class_servRepository.inc
index d6006348d893d099b6ff429bbe3be5fee1287fb6..c95860729cf54c183c1d698d635f0b1c9e15f205 100644 (file)
<?php
-require_once("class_goService.inc");
-
class servrepository extends goService
{
/* CLI vars */
/* Search filter */
var $regex = "*";
- /* Configurationdialog for repositories */
- var $dialog = NULL;
-
/* Repositories */
var $repositories = array();
var $FAIrepository = array();
var $conflicts = array("FAIrepositoryServer");
var $DisplayName = "";
var $StatusFlag = "";
+
+ var $view_logged = FALSE;
+ var $fai_activated = FALSE;
-
- function servrepository ($config, $dn= NULL, $parent= NULL)
+ function servrepository (&$config, $dn= NULL, $parent= NULL)
{
plugin::plugin ($config, $dn, $parent);
$this->DisplayName = _("Repository service");
+ /* Skip this if fai is deactivated */
+ $tmp= $this->config->search("faiManagement", "CLASS",array('menu','tabs'));
+ if(!empty($tmp)){
+ $this->fai_activated = TRUE;
+ }else{
+ return;
+ }
+
$this->repositories = array();
if(isset($this->attrs['FAIrepository'])){
for($i = 0; $i < $this->attrs['FAIrepository']['count']; $i++){
/* Call parent execute */
plugin::execute();
+ if($this->is_account && !$this->view_logged){
+ $this->view_logged = TRUE;
+ new log("view","server/".get_class($this),$this->dn);
+ }
+
+ if(!$this->fai_activated){
+ $str = "<h2>"._("You can't use this plugin until FAI is activated.")."</h2>";
+ return $str;
+ }
+
/* Fill templating stuff */
$smarty= get_smarty();
$smarty->assign("is_createable",$this->acl_is_createable());
}else{
$this->repositories[$obj['Release']]=$obj;
}
- $this->dialog = NULL;
+ $this->dialog = FALSE;
$this->is_dialog= false;
}
}
if(isset($_POST['repository_setup_cancel'])){
- $this->dialog=NULL;
+ $this->dialog=FALSE;
$this->is_dialog = false;
}
- if($this->dialog != NULL){
+ if(is_object($this->dialog)){
$this->dialog->save_object();
$this->is_dialog = true;
return($this->dialog->execute());
Repository setup dialog handling /END
*/
- $divlist = new divList("repositories");
+ $divlist = new divlist("repositories");
$divlist->SetEntriesPerPage(0);
$divlist->setHeight(400);
+ $divlist->SetPluginMode();
$divlist->setHeader(array(array("string"=>_("Release"),"attach"=>"style='width:80px;'"),
array("string"=>_("Sections")),
/* Save to LDAP */
function save()
{
+ if(!$this->fai_activated) return;
+
plugin::save();
$arr = array();
$ldap->add($this->attrs);
$this->handle_post_events("add");
}
+
+ if($this->initially_was_account){
+ new log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }else{
+ new log("create","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }
}
{
return (array(
"plShortName" => _("Repository"),
- "plDescription" => _("Repository service"),
+ "plDescription" => _("Repository service")." ("._("Services").")",
"plSelfModify" => FALSE,
"plDepends" => array(),
- "plPriority" => 0,
+ "plPriority" => 84,
"plSection" => array("administration"),
"plCategory" => array("server"),