NAVIGATION
This shows you the differences between two versions of the page.
|
deutsch:andere-erweiterungen:hacks:superuser [2009/11/22 09:32] Knut Heermann (flip-flop) created |
deutsch:andere-erweiterungen:hacks:superuser [2018/06/03 18:09] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Superuser [BE] ====== | ====== Superuser [BE] ====== | ||
| - | FIXME Translate to German | ||
| - | **Backend:** This is a really dirty solution but it works well and should be a fine quick hack to let users work with admin rights but not edit admin section without special superuser check. | + | **Backend:** Dis ist eine sehr einfache Lösung - ein schneller Hack, damit Benutzer mit Admin-Rechten arbeiten, jedoch keine Admin-Bereiche ohne einen speziellen Super-Usercheck editieren können. |
| Docu: -- \\ | Docu: -- \\ | ||
| Line 17: | Line 17: | ||
| - | **file name:** navi_text.inc.php | + | **Dateiname:** navi_text.inc.php |
| - | **location:** include/inc_lib/ | + | **Verzeichnis:** include/inc_lib/ |
| ---- | ---- | ||
| - | Unzip the attached file | + | \\ |
| + | Unzip die anhängende Datei {{:english:other-enhancements:hacks:navi_text.inc.php.zip|navi_text.inc.php.zip}} | ||
| - | and replace navi_text.inc.php at include/inc_lib/ (maybe make a backup of original navi_text.inc.php). | + | und tausche navi_text.inc.php in include/inc_lib/ //(mache vorher ein Backup der Originaldatei)//. |
| - | Inside that file you can find a new "hidden" word - set it | + | In der Datei findest du ein neues "verstecktes" Wort - ersetze |
| <code php> $phpwcms['superuser_checkword'] = 'muschi';</code> | <code php> $phpwcms['superuser_checkword'] = 'muschi';</code> | ||
| - | to whatever you like and keep it in mind. | + | mit irgendeinem Wort was dir gefällt und vergesse es nicht. |
| - | By default the you will never see the admin menu until you type in the superuser URI like that: \\ | + | Das Admin-Menü wird nicht angezeigt, solange die Superuser URI nicht eingegeben wird: \\ |
| - | mysite.com/phpwcms.php?superuser=muschi | + | **mysite.com/phpwcms.php?superuser=muschi** |
| - | See the images: | + | Schaue dir die Bilder an: |
| {{:english:other-enhancements:hacks:superuser01_be.gif|}} | {{:english:other-enhancements:hacks:superuser01_be.gif|}} | ||
| Line 49: | Line 50: | ||
| - | Then the superuser is registered in session and admin menu will be available as long as your session is active. | + | Nun ist der Superuser in dieser Session registriert und das Admin-Menü bleibt sichtbar, solange die Session gültig ist. |
| \\ | \\ | ||
| + | ~~UP~~ | ||
| + | |||
| + | ===== Variante 01 ===== | ||
| + | |||
| + | Nur für diese eingetragenen Admin-Benutzer ist das Admin-Menü verfügbar. \\ | ||
| + | Im Beispiel für die Benutzer mit den Benutzernamen "hans" und "erwin". | ||
| + | |||
| + | Die Idee basiert darauf, das alle Benutzer Adminrechte erhalten jedoch nicht das Admin-Menü sehen. | ||
| + | |||
| + | |||
| + | **Datei:** include/inc_lib/navi_text.inc.php | ||
| + | |||
| + | Ersetze | ||
| + | <code php> | ||
| + | $wcsnav["admin"] = '<a href="phpwcms.php?do=admin&p=6">'.$BL['be_nav_admin'].'</a>'; | ||
| + | </code> | ||
| + | |||
| + | durch | ||
| + | |||
| + | <code php> | ||
| + | // +KH: 14.04.10 Only for this registered admin user the admin menu is available | ||
| + | // ----------------------------------------------------- | ||
| + | if ($_SESSION['wcs_user'] === 'hans' OR | ||
| + | $_SESSION['wcs_user'] === 'erwin') | ||
| + | $wcsnav["admin"] = '<a href="phpwcms.php?do=admin&p=6">'.$BL['be_nav_admin'].'</a>'; | ||
| + | // ----------------------------------------------------- | ||
| + | </code> | ||
| + | |||
| + | \\ | ||
| + | ~~UP~~ | ||
| + | |||
| + | ===== Variante 02 ===== | ||
| + | |||
| + | Getestet in V 1.4.6 r402 | ||
| + | |||
| + | Für diese eingetragenen Admin-Benutzer ist das Admin-Menü **nicht** verfügbar. \\ | ||
| + | Im Beispiel für die Benutzer mit den Benutzernamen "oblong" und "don-blech". | ||
| + | |||
| + | Die Idee basiert darauf, das alle Benutzer Adminrechte erhalten jedoch nicht das Admin-Menü sehen. | ||
| + | |||
| + | Darüberhinaus wird noch die CP-Auswahl für die eingetragenen User reduziert. | ||
| + | |||
| + | Dazu wird ein Duplikat der Datei "include/inc_lib/article.contenttype.inc.php" erzeugt und die entsprechenden CPs gesperrt oder freigegeben. \\ | ||
| + | -> Neuer Dateiname: "include/inc_lib/article.contenttype_small.inc.php" | ||
| + | |||
| + | \\ | ||
| + | |||
| + | ==== Menü sperren ==== | ||
| + | |||
| + | **Datei:** include/inc_lib/navi_text.inc.php | ||
| + | |||
| + | Ersetze | ||
| + | <code php> | ||
| + | $wcsnav["admin"] = '<a href="phpwcms.php?do=admin&p=6">'.$BL['be_nav_admin'].'</a>'; | ||
| + | </code> | ||
| + | |||
| + | durch | ||
| + | |||
| + | <code php> | ||
| + | // +KH: 14.04.10 Only for this registered admin user the admin menu is available | ||
| + | // ----------------------------------------------------- | ||
| + | if ($_SESSION['wcs_user'] !== 'oblong' AND | ||
| + | $_SESSION['wcs_user'] !== 'don-blech') | ||
| + | $wcsnav["admin"] = '<a href="phpwcms.php?do=admin&p=6">'.$BL['be_nav_admin'].'</a>'; | ||
| + | // ----------------------------------------------------- | ||
| + | </code> | ||
| + | \\ | ||
| + | |||
| + | ==== CPs filtern ==== | ||
| + | |||
| + | **Datei:** phpwcms.php | ||
| + | |||
| + | Ersetze //(etwa in Zeile 87)// | ||
| + | <code php> | ||
| + | include(PHPWCMS_ROOT.'/include/inc_lib/article.contenttype.inc.php'); //loading array with actual content types | ||
| + | </code> | ||
| + | |||
| + | durch | ||
| + | |||
| + | <code php> | ||
| + | // +KH: 14.04.10 This user has a special contentpart list | ||
| + | // --------------------------------------------------------- | ||
| + | if ($_SESSION['wcs_user'] !== 'oblong' AND $_SESSION['wcs_user'] !== 'don-blech') | ||
| + | include(PHPWCMS_ROOT.'/include/inc_lib/article.contenttype.inc.php'); //loading array with actual content types | ||
| + | else | ||
| + | include(PHPWCMS_ROOT.'/include/inc_lib/article.contenttype_small.inc.php'); //loading array with small content type list | ||
| + | // --------------------------------------------------------- | ||
| + | </code> | ||
| + | \\ | ||
| + | |||
| + | **Die Datei** "include/inc_lib/article.contenttype_small.inc.php" wird neu erzeugt und die nicht verwendbaren CPs auskommentiert. | ||
| + | |||
| + | <code php|h article.contenttype_small.inc.php |h> | ||
| + | <?php | ||
| + | /************************************************************************************* | ||
| + | Copyright notice | ||
| + | |||
| + | (c) 2002-2010 Oliver Georgi (oliver@phpwcms.de) // All rights reserved. | ||
| + | |||
| + | This script is part of PHPWCMS. The PHPWCMS web content management system is | ||
| + | free software; you can redistribute it and/or modify it under the terms of | ||
| + | the GNU General Public License as published by the Free Software Foundation; | ||
| + | either version 2 of the License, or (at your option) any later version. | ||
| + | |||
| + | The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html | ||
| + | A copy is found in the textfile GPL.txt and important notices to the license | ||
| + | from the author is found in LICENSE.txt distributed with these scripts. | ||
| + | |||
| + | This script is distributed in the hope that it will be useful, but WITHOUT ANY | ||
| + | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
| + | PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
| + | |||
| + | This copyright notice MUST APPEAR in all copies of the script! | ||
| + | *************************************************************************************/ | ||
| + | |||
| + | // Content Part Types | ||
| + | // DO NOT define 30 = used for modules | ||
| + | $wcs_content_type = array( | ||
| + | 0 => $BL['be_ctype_plaintext'] , | ||
| + | //kh 6 => $BL['be_ctype_html'], | ||
| + | 14 => $BL['be_ctype_wysywig'], | ||
| + | //kh 11 => $BL['be_ctype_code'], | ||
| + | 1 => $BL['be_ctype_textimage'], | ||
| + | 29 => $BL['be_ctype_imagesdiv'], | ||
| + | //kh 31 => $BL['be_ctype_imagesspecial'], | ||
| + | //kh 32 => $BL['be_ctype_tabs'], | ||
| + | 2 => $BL['be_ctype_images'], | ||
| + | //kh 4 => $BL['be_ctype_bulletlist'], | ||
| + | //kh 100 => $BL['be_ctype_ullist'], | ||
| + | //kh 3 => $BL['be_ctype_link'], | ||
| + | 5 => $BL['be_ctype_linklist'], | ||
| + | 8 => $BL['be_ctype_linkarticle'], | ||
| + | //kh 33 => $BL['be_news'], | ||
| + | 15 => $BL['be_ctype_articlemenu'], | ||
| + | //kh 9 => $BL['be_ctype_multimedia'], | ||
| + | 7 => $BL['be_ctype_filelist'], | ||
| + | //kh 16 => $BL['be_ctype_ecard'], | ||
| + | //17 => $BL['be_ctype_blog'], | ||
| + | //kh 23 => $BL['be_ctype_simpleform'], | ||
| + | //kh 10 => $BL['be_ctype_emailform'].' [old]', | ||
| + | //kh 12 => $BL['be_ctype_newsletter'], | ||
| + | //kh 13 => $BL['be_ctype_search'], | ||
| + | //kh 18 => $BL['be_ctype_guestbook'], | ||
| + | //kh 19 => $BL['be_ctype_sitemap'], | ||
| + | //20 => $BL['be_ctype_bid'], | ||
| + | //kh 21 => $BL['be_ctype_pages'], | ||
| + | //kh 22 => $BL['be_ctype_rssfeed'], | ||
| + | //kh 50 => $BL['be_ctype_reference'], | ||
| + | //kh 51 => $BL['be_ctype_map'], | ||
| + | //kh 52 => $BL['be_ctype_phpvar'], | ||
| + | //53 => $BL['be_ctype_forum'], | ||
| + | //kh 24 => $BL['be_ctype_alias'], | ||
| + | //kh 89 => $BL['be_ctype_poll'], // jens poll | ||
| + | //kh 26 => $BL['be_ctype_recipe'], | ||
| + | //kh 27 => $BL['be_ctype_faq'], | ||
| + | //kh 28 => $BL['be_ctype_felogin'], | ||
| + | //kh 25 => $BL['be_ctype_flashplayer'] | ||
| + | ); | ||
| + | |||
| + | // set module content parts = 30 | ||
| + | if(count($phpwcms['modules'])) { | ||
| + | foreach($phpwcms['modules'] as $value) { | ||
| + | if($value['cntp']) { | ||
| + | $wcs_content_type[30] = $BL['be_ctype_module']; | ||
| + | break; | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | ?> | ||
| + | </code> | ||
| + | |||
| + | Die Auswahlreihenfolge der CPs im BE ist abhängig von der Reihenfolge der Einträge in dieser Datei. //(Siehe auch: [[deutsch/technik/aufruf-interner-funktionen/content_part_typen]])//. | ||
| + | |||
| + | \\ | ||