Commit 18341ee3 authored by tbrehm's avatar tbrehm

Added the website management module.

parent 7ae9f9d8
......@@ -760,7 +760,7 @@ class tform {
} else {
if($primary_id != 0) {
$sql_update = substr($sql_update,0,-2);
$sql = "UPDATE ".$escape.$this->formDef['db_table'].$escape." SET ".$sql_update." WHERE ".$this->formDef['db_table_idx']." = ".$primary_id;
$sql = "UPDATE ".$escape.$this->formDef['db_table'].$escape." SET ".$sql_update." WHERE ".$this->getAuthSQL('u')." AND ".$this->formDef['db_table_idx']." = ".$primary_id;
if($sql_ext_where != '') $sql .= " and ".$sql_ext_where;
} else {
$app->error("Primary ID fehlt!");
......@@ -796,20 +796,21 @@ class tform {
// definiere Tabs
foreach( $this->formDef["tabs"] as $key => $tab) {
$tab['name'] = $key;
$tab['name'] = $key;
if($tab['name'] == $active_tab) {
// Wenn Modul gesetzt, dann setzte template pfad relativ zu modul.
if($this->module != '') $tab["template"] = "../".$this->module."/".$tab["template"];
// Wenn Modul gesetzt, dann setzte template pfad relativ zu modul.
if($this->module != '') $tab["template"] = "../".$this->module."/".$tab["template"];
// berprfe, ob das Template existiert, wenn nicht
// dann generiere das Template
if(!is_file($tab["template"])) {
$app->uses('tform_tpl_generator');
$app->tform_tpl_generator->buildHTML($this->formDef,$tab['name']);
}
// berprfe, ob das Template existiert, wenn nicht
// dann generiere das Template
if(!is_file($tab["template"])) {
$app->uses('tform_tpl_generator');
$app->tform_tpl_generator->buildHTML($this->formDef,$tab['name']);
}
$app->tpl->setInclude('content_tpl',$tab["template"]);
$app->tpl->setInclude('content_tpl',$tab["template"]);
$tab["active"] = 1;
$_SESSION["s"]["form"]["tab"] = $tab['name'];
} else {
......
<?php
/*
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
Form Definition
Tabellendefinition
Datentypen:
- INTEGER (Wandelt Ausdrücke in Int um)
- DOUBLE
- CURRENCY (Formatiert Zahlen nach Währungsnotation)
- VARCHAR (kein weiterer Format Check)
- TEXT (kein weiterer Format Check)
- DATE (Datumsformat, Timestamp Umwandlung)
Formtype:
- TEXT (normales Textfeld)
- TEXTAREA (normales Textfeld)
- PASSWORD (Feldinhalt wird nicht angezeigt)
- SELECT (Gibt Werte als option Feld aus)
- RADIO
- CHECKBOX
- FILE
VALUE:
- Wert oder Array
Hinweis:
Das ID-Feld ist nicht bei den Table Values einzufügen.
*/
$form["title"] = "IP Addresses";
$form["description"] = "Form to edit system IP Addresses";
$form["name"] = "server_ip";
$form["action"] = "server_ip_edit.php";
$form["db_table"] = "server_ip";
$form["db_table_idx"] = "server_ip_id";
$form["db_history"] = "yes";
$form["tab_default"] = "server_ip";
$form["list_default"] = "server_ip_list.php";
$form["auth"] = 'yes';
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
$form["tabs"]['server_ip'] = array (
'title' => "IP Address",
'width' => 80,
'template' => "templates/server_ip_edit.htm",
'fields' => array (
##################################
# Beginn Datenbankfelder
##################################
'server_id' => array (
'datatype' => 'INTEGER',
'formtype' => 'SELECT',
'default' => '',
'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
'keyfield'=> 'server_id',
'valuefield'=> 'server_name'
),
'value' => ''
),
'ip_address' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'ip_error_empty'),
1 => array ( 'type' => 'UNIQUE',
'errmsg'=> 'ip_error_unique'),
2 => array ( 'type' => 'REGEX',
'regex' => '/^[0-9\.]{7,15}$/',
'errmsg'=> 'ip_err'),
),
'default' => '',
'value' => '',
'separator' => '',
'width' => '15',
'maxlength' => '15',
'rows' => '',
'cols' => ''
),
'virtualhost' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'y',
'value' => array(0 => 'n',1 => 'y')
),
##################################
# ENDE Datenbankfelder
##################################
)
);
?>
\ No newline at end of file
<?php
$wb["server_id_txt"] = 'Server';
$wb["ip_address_txt"] = 'IP Address';
$wb["virtualhost_txt"] = 'Virtualhost';
$wb["ip_err"] = 'IP address invalid';
$wb["btn_save_txt"] = 'Save';
$wb["btn_cancel_txt"] = 'Cancel';
?>
\ No newline at end of file
<?php
$wb["list_head_txt"] = 'IP Addresses';
$wb["server_id_txt"] = 'Server';
$wb["ip_address_txt"] = 'IP Address';
$wb["page_txt"] = 'Page';
$wb["page_of_txt"] = 'of';
$wb["page_next_txt"] = 'Next';
$wb["page_back_txt"] = 'Back';
$wb["delete_txt"] = 'Delete';
$wb["filter_txt"] = 'Filter';
$wb["add_new_record_txt"] = 'Add new IP Address';
?>
\ No newline at end of file
......@@ -49,7 +49,15 @@ $items[] = array( 'title' => "Edit server",
'target' => 'content',
'link' => 'admin/server_list.php');
$items[] = array( 'title' => "Add Server IP",
'target' => 'content',
'link' => 'admin/server_ip_edit.php');
$items[] = array( 'title' => "Edit Server IP",
'target' => 'content',
'link' => 'admin/server_ip_list.php');
$module["nav"][] = array( 'title' => 'Servers',
'open' => 1,
'items' => $items);
......
<?php
/*
Datentypen:
- INTEGER (Wandelt Ausdrücke in Int um)
- DOUBLE
- CURRENCY (Formatiert Zahlen nach Währungsnotation)
- VARCHAR (kein weiterer Format Check)
- TEXT (kein weiterer Format Check)
- DATE (Datumsformat, Timestamp Umwandlung)
*/
// Name der Liste
$liste["name"] = "server_ip";
// Datenbank Tabelle
$liste["table"] = "server_ip";
// Index Feld der datenbank
$liste["table_idx"] = "server_ip_id";
// Search Field Prefix
$liste["search_prefix"] = "search_";
// Einträge pro Seite
$liste["records_per_page"] = 15;
// Script File der Liste
$liste["file"] = "server_ip_list.php";
// Script File der Liste
$liste["edit_file"] = "server_ip_edit.php";
// Script File der Liste
$liste["delete_file"] = "server_ip_del.php";
// Paging Template
$liste["paging_tpl"] = "templates/paging.tpl.htm";
// Script File der Liste
$liste["auth"] = "no";
/*****************************************************
* Suchfelder
*****************************************************/
$liste["item"][] = array( 'field' => "server_id",
'datatype' => "VARCHAR",
'formtype' => "SELECT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
'keyfield'=> 'server_id',
'valuefield'=> 'server_name'
),
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "ip_address",
'datatype' => "VARCHAR",
'op' => "=",
'prefix' => "",
'suffix' => "",
'width' => "");
?>
\ No newline at end of file
<?php
/*
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/******************************************
* Begin Form configuration
******************************************/
$list_def_file = "list/server_ip.list.php";
$tform_def_file = "form/server_ip.tform.php";
/******************************************
* End Form configuration
******************************************/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
// Checke Berechtigungen für Modul
if(!stristr($_SESSION["s"]["user"]["modules"],'admin')) {
header("Location: ../index.php");
exit;
}
$app->uses("tform_actions");
$app->tform_actions->onDelete();
?>
\ No newline at end of file
<?php
/*
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/******************************************
* Begin Form configuration
******************************************/
$tform_def_file = "form/server_ip.tform.php";
/******************************************
* End Form configuration
******************************************/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
// Checking module permissions
if(!stristr($_SESSION["s"]["user"]["modules"],'admin')) {
header("Location: ../index.php");
exit;
}
// Loading classes
$app->uses('tpl,tform,tform_actions');
// let tform_actions handle the page
$app->tform_actions->onLoad();
?>
\ No newline at end of file
<?php
/*
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
/******************************************
* Begin Form configuration
******************************************/
$list_def_file = "list/server_ip.list.php";
/******************************************
* End Form configuration
******************************************/
// Checking module permissions
if(!stristr($_SESSION["s"]["user"]["modules"],'admin')) {
header("Location: ../index.php");
exit;
}
$app->uses('listform_actions');
$app->listform_actions->onLoad();
?>
\ No newline at end of file
<table width="500" border="0" cellspacing="0" cellpadding="2">
<tr>
<td class="frmText11">{tmpl_var name='server_id_txt'}:</td>
<td class="frmText11">
<select name="server_id" class="text">
{tmpl_var name='server_id'}
</select>
</td>
</tr>
<tr>
<td class="frmText11">{tmpl_var name='ip_address_txt'}:</td>
<td class="frmText11"><input name="ip_address" type="text" class="text" value="{tmpl_var name='ip_address'}" size="15" maxlength="15"></td>
</tr>
<tr>
<td width="126" class="frmText11">{tmpl_var name='virtualhost_txt'}:</td>
<td width="366" class="frmText11">{tmpl_var name='virtualhost'}</td>
</tr>
<tr>
<td class="frmText11">&nbsp;</td>
<td class="frmText11">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input name="btn_save" type="button" class="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','admin/server_ip_edit.php');"><div class="buttonEnding"></div>&nbsp;
<input name="btn_cancel" type="button" class="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('admin/server_ip_list.php');"><div class="buttonEnding"></div>
</td>
</tr>
</table>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
\ No newline at end of file
<div class="frmTextHead"><tmpl_var name="list_head_txt"></div><br />
<input type="button" value="{tmpl_var name="add_new_record_txt"}" class="button" onClick="loadContent('admin/server_ip_edit.php');" /><div class="buttonEnding"></div><br /><br />
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="listTable">
<tr>
<td class="tblHead"><tmpl_var name="server_id_txt"></td>
<td class="tblHead"><tmpl_var name="ip_address_txt"></td>
<td class="tblHead">&nbsp;</td>
</tr>
<tr>
<td class="frmText11"><select name="search_server_id" onChange="submitForm('pageForm','admin/server_ip_list.php');">{tmpl_var name='search_server_id'}</select></td>
<td class="frmText11"><input type="text" name="search_ip_address" value="{tmpl_var name='search_ip_address'}" class="text" /></td>
<td class="frmText11" align="right"><input name="Filter" type="button" id="Filter" value="{tmpl_var name="filter_txt"}" class="button" onClick="submitForm('pageForm','admin/server_ip_list.php');"><div class="buttonEnding"></div></td>
</tr>
<tmpl_loop name="records">
<tr bgcolor="{tmpl_var name="bgcolor"}">
<td class="frmText11"><a href="#" onClick="loadContent('admin/server_ip_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="server_id"}</a></td>
<td class="frmText11"><a href="#" onClick="loadContent('admin/server_ip_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="ip_address"}</a></td>
<td class="frmText11" align="right">[<a href="javascript: del_record('admin/server_ip_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}');" class="frmText11">{tmpl_var name='delete_txt'}</a>]</td>
</tr>
</tmpl_loop>
<tr>
<td colspan="3" height="40" align="center" class="tblFooter"><tmpl_var name="paging"></td>
</tr>
</table>
\ No newline at end of file
......@@ -66,7 +66,7 @@ class page_action extends tform_actions {
$username = addslashes($this->dataRecord["username"]);
$password = addslashes($this->dataRecord["password"]);
$modules = 'mail';
$modules = 'mail,sites';
$startmodule = 'mail';
$usertheme = addslashes($this->dataRecord["usertheme"]);
$type = 'user';
......
......@@ -194,4 +194,18 @@ function reportError(request)
if(window.confirm("<tmpl_var name='delete_confirmation'>")) {
loadContent(link);
}
}
function loadContentInto(elementid,pagename) {
var itemContentCallback = {
success: function(o) {
document.getElementById(elementid).innerHTML = o.responseText;
},
failure: function(o) {
alert('Ajax Request was not successful.');
}
}
var pageContentObject2 = YAHOO.util.Connect.asyncRequest('GET', pagename, itemContentCallback);
}
\ No newline at end of file
<?php
/*
Copyright (c) 2005, Till Brehm, projektfarm Gmbh
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
......
<?php
/*
Copyright (c) 2005, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
// Checking module permissions
if(!stristr($_SESSION["s"]["user"]["modules"],'sites')) {
header("Location: ../index.php");