79 lines
No EOL
3.4 KiB
PHP
79 lines
No EOL
3.4 KiB
PHP
<?php global $session;
|
|
/**
|
|
* Project: BeCast WebEngine - simple site engine
|
|
* File: /admin/addgroup.apnl.php
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
*
|
|
* This library 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
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
*
|
|
* @link http://www.becast.at
|
|
* @copyright 2009-2025 becast.at
|
|
* @author Bernhard Jaud <bernhard at becast dot at>
|
|
* @package BcWe core
|
|
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
|
* @version $Id$
|
|
*/
|
|
|
|
If (!defined("IN_BCWE_ADMIN")) {
|
|
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
|
|
}
|
|
$addnav["right"]=FALSE;
|
|
$session->page_begin("addgroup", True);
|
|
|
|
class addgroup_panel extends admin_module{
|
|
|
|
function output(){
|
|
global $session,$config,$db,$panel,$admin,$module,$root,$firephp,$log;
|
|
if(isset($_POST["send"])){
|
|
if(!empty($_POST["name"])){
|
|
$db->query("BEGIN");
|
|
$db->query("INSERT INTO `" . $config["prefix"] . "role` (`role_name`) VALUES ('".$db->escape($_POST["name"])."')");
|
|
$role_id=$db->last_id();
|
|
unset($_POST["name"]);
|
|
unset($_POST["submit"]);
|
|
unset($_POST["send"]);
|
|
foreach($_POST as $key=>$value){
|
|
$db->query("INSERT INTO `" . $config["prefix"] . "roleset` (`role_id`,`role_value_id`,`value`) VALUES ('".intval($role_id)."','".intval($key)."','".$db->escape($value)."')");
|
|
}
|
|
$db->query("COMMIT");
|
|
$panel->admin_message("Daten übernommen!","Die Daten wurden erfolgreich übernommen.",True,"addgroup",3);
|
|
}else{
|
|
$panel->admin_message("Fehler!","Der Rollenname muss ausgefüllt werden.",True,"addgroup",3);
|
|
}
|
|
|
|
}else{
|
|
$result = $db->query("SELECT * FROM " . $config["prefix"] . "role_values");
|
|
$panel->title="Gruppe anlegen";
|
|
$panel->content='Hier kann man Benutzergruppen anlegen.';
|
|
$panel->form(array("action"=>$config["path"]."/admin/index.php?panel=addgroup"));
|
|
$panel->content.="<h3>Gruppename:</h3>";
|
|
$panel->field(array("name"=>"name","typ"=>"text","value"=>""));
|
|
$panel->content.="<br /><br />";
|
|
$panel->content.="<table style=\"width: 90%; border-spacing: 2px;\">
|
|
<tr>
|
|
<th><strong>Rechte</strong></th>
|
|
</tr>";
|
|
while ($row = $db->fetch_array($result)){
|
|
$panel->content.="<tr><td><strong>".$row["text"].":</strong><br />".$panel->get_option($row["type"],$row["id"])."</td></tr>";
|
|
}
|
|
$panel->content.="</table><br />";
|
|
$panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1"));
|
|
$panel->content.="<br />";
|
|
$panel->submit();
|
|
$panel->formClose();
|
|
}
|
|
}
|
|
|
|
}
|
|
?>
|