27 protected static $showActions = TRUE;
29 protected $status =
'';
31 public $conflicts = [];
32 public $DisplayName =
'';
47 $this->ignore_account = FALSE;
49 $plInfos = pluglist::pluginInfos(get_class($this));
50 $this->DisplayName = $plInfos[
'plShortName'];
57 $str = parent::render();
60 $str .=
'<p class="plugbottom servicebottom">'.
61 ' <input type="submit" name="SaveService" value="'.msgPool::saveButton().
'"/> '.
62 ' <input type="submit" formnovalidate="formnovalidate" name="CancelService" value="'.msgPool::cancelButton().
'"/>'.
69 protected function acl_skip_write ():
bool 78 $fields[
'Status'] = $this->status;
81 $fields[
'Message'] = $this->DisplayName;
83 if (static::$showActions && is_object($this->parent->parent) && isset($this->parent->parent->by_object[
'argonautClient']) && $this->parent->parent->by_object[
'argonautClient']->is_account) {
85 $fields[
'AllowStatus'] = ($this->status ==
'') && $this->
acl_is_writeable(
'simpleServiceStatus');
86 $fields[
'AllowStart'] = ($this->status ==
'stopped') && $this->
acl_is_writeable(
'simpleServiceStart');
87 $fields[
'AllowStop'] = ($this->status ==
'running') && $this->
acl_is_writeable(
'simpleServiceStop');
88 $fields[
'AllowRestart'] = ($this->status ==
'running') && $this->
acl_is_writeable(
'simpleServiceRestart');
91 $fields[
'AllowStatus'] = FALSE;
92 $fields[
'AllowStart'] = FALSE;
93 $fields[
'AllowStop'] = FALSE;
94 $fields[
'AllowRestart'] = FALSE;
107 if (!$this->initially_was_account) {
111 $this->status = $value;
114 static function generatePlProvidedAcls (array
$attributesInfo,
bool $operationalAttributes = NULL): array
116 $acls = parent::generatePlProvidedAcls($attributesInfo);
117 if (static::$showActions) {
118 $acls [
'simpleServiceStatus'] = _(
'Get service status');
119 $acls [
'simpleServiceStart'] = _(
'Start service');
120 $acls [
'simpleServiceStop'] = _(
'Stop service');
121 $acls [
'simpleServiceRestart'] = _(
'Restart service');
$parent
Reference to parent object.
This class is made for easy plugin creation for editing LDAP attributes.
__construct($dn=NULL, $parent=NULL, $attributesInfo=NULL)
constructor
acl_is_readable($attribute)
Can we read the acl.
$dn
dn of the opened object
acl_is_writeable($attribute, bool $skipWrite=FALSE)
Can we write the attribute.
getListEntry()
Get service information for servicesManagement plugin.
This class is made for easy service creation for editing LDAP attributes.
acl_is_removeable(string $base=NULL)
Can we delete the object.
render()
This function display the service and return the html code.
$attributesInfo
This attribute store all information about attributes.
setStatus($value)
This function save new status flag.