Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ Creates a printable list

Contact search results are display on the search results page. In order to activate links to show or edit a contact, a page id must be stated, to which the link directs. This target page must contatin an ``[ADDRESSBOOK:]``-Tag for the request to performed.

### Option 'use ACL permissions'

Required access level ([ACL](https://www.dokuwiki.org/acl#background_info)) to edit the addressbook. The value 'no' uses the classic check: access via the setting of 'ismanager' in [$INFO](https://www.dokuwiki.org/devel:environment#info).

## Issues / Ideas

Expand Down
2 changes: 1 addition & 1 deletion conf/default.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php
$conf['search link target'] = '';

$conf['use ACL permissions'] = 'no';
1 change: 1 addition & 0 deletions conf/metadata.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<?php
$meta['search link target'] = array('string');
$meta['use ACL permissions'] = array('multichoice', '_choices' => array('no','AUTH_NONE','AUTH_READ','AUTH_EDIT','AUTH_CREATE','AUTH_UPLOAD','AUTH_DELETE','AUTH_ADMIN'));
1 change: 1 addition & 0 deletions lang/de/settings.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<?php
$lang['search link target'] = "Ziel-Seite (id) für links im Bereich der Suchergebnisse. Diese muss einen [ADDRESSBOOK:]-Tag enthalten, damit der Auftrag verarbeitet werden kann";
$lang['use ACL permissions'] = "Benötigtes Zugriffslevel zum Bearbeiten des Adressbuchs. Beim Wert 'no' wird das klassische Zugriffsrecht angewandt: die Prüfung auf den Eigenschaftswert von 'ismanager' in \$INFO.";
1 change: 1 addition & 0 deletions lang/en/settings.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<?php
$lang['search link target'] = "Target id for links on the search page. The target page must contain an [ADDRESSSBOOK:]-Tag";
$lang['use ACL permissions'] = "Required access level (ACL) to edit the addressbook. The value 'no' uses the classic check: access via the setting of 'ismanager' in \$INFO.";
43 changes: 42 additions & 1 deletion syntax.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,48 @@ public function getPType() {

function __construct(){
global $INFO;
if ($INFO['ismanager'] === true) $this->editor = true;

$permissionlevel = auth_quickaclcheck($data['name']);
switch ($this->getConf('use ACL permissions')) {
case 'no':
if ($INFO['ismanager'] === true) $this->editor = true;
break;
case 'AUTH_NONE':
if ($permissionlevel >= AUTH_NONE) {
$this->editor = true;
}
break;
case 'AUTH_READ':
if ($permissionlevel >= AUTH_READ) {
$this->editor = true;
}
break;
case 'AUTH_EDIT':
if ($permissionlevel >= AUTH_EDIT) {
$this->editor = true;
}
break;
case 'AUTH_CREATE':
if ($permissionlevel >= AUTH_CREATE) {
$this->editor = true;
}
break;
case 'AUTH_UPLOAD':
if ($permissionlevel >= AUTH_UPLOAD) {
$this->editor = true;
}
break;
case 'AUTH_DELETE':
if ($permissionlevel >= AUTH_DELETE) {
$this->editor = true;
}
break;
case 'AUTH_ADMIN':
if ($permissionlevel >= AUTH_ADMIN) {
$this->editor = true;
}
break;
}
if (isset($INFO['userinfo'])) $this->loggedin = true;
}

Expand Down