[Commits] r638 - in trunk/webinterface: core mods/super mods/super/customers mods/super/nodes mods/super/settings mods/user themes/default
new-commit at lists.openvcp.org
new-commit at lists.openvcp.org
Mon Dec 29 19:52:20 UTC 2008
Author: ftx
Date: 2008-12-29 19:52:19 +0000 (Mon, 29 Dec 2008)
New Revision: 638
Added:
trunk/webinterface/themes/default/cube.png
Modified:
trunk/webinterface/core/Admin.class.php
trunk/webinterface/core/GUI.php
trunk/webinterface/core/OpenVCP.php
trunk/webinterface/mods/super/customers/main.php
trunk/webinterface/mods/super/main.php
trunk/webinterface/mods/super/nodes/control.php
trunk/webinterface/mods/super/search.php
trunk/webinterface/mods/super/settings/navi.php
trunk/webinterface/mods/user/main.php
trunk/webinterface/themes/default/theme.css
trunk/webinterface/themes/default/theme.html
Log:
visual improvements, added button to reset login informations of a customer
Closes: #213
Modified: trunk/webinterface/core/Admin.class.php
===================================================================
--- trunk/webinterface/core/Admin.class.php 2008-12-29 19:49:08 UTC (rev 637)
+++ trunk/webinterface/core/Admin.class.php 2008-12-29 19:52:19 UTC (rev 638)
@@ -156,4 +156,4 @@
}
-?>
\ No newline at end of file
+?>
Modified: trunk/webinterface/core/GUI.php
===================================================================
--- trunk/webinterface/core/GUI.php 2008-12-29 19:49:08 UTC (rev 637)
+++ trunk/webinterface/core/GUI.php 2008-12-29 19:52:19 UTC (rev 638)
@@ -65,7 +65,8 @@
* @var string
*/
protected $contentMenu = "";
-
+ protected $infoMenu = "";
+
/**
* Contains additional content
* for the menu html data
@@ -250,6 +251,7 @@
$this->template = str_replace('{BANNER}' , OpenVCP::getWebPath().DIRECTORY_SEPARATOR.$this->config['relPath'].DIRECTORY_SEPARATOR.$this->config['defaultTheme'].DIRECTORY_SEPARATOR."banner.png", $this->template);
$this->template = str_replace('{CONTENTMENU}', "<ul>" . $this->contentMenu . "</ul>", $this->template);
+ $this->template = str_replace('{INFOMENU}', "<ul>" . $this->infoMenu . "</ul>", $this->template);
$this->template = str_replace('{HEADERMENU}' , "<ul>" . $this->headerMenu . "</ul>", $this->template);
$this->template = str_replace('{TITLE}' , $this->pageTitle, $this->template);
@@ -335,17 +337,22 @@
*/
private function createContentMenu($dir)
{
+
+
if(count($this->contentMenuAdd)>0)
{
+ $headOpen = false;
+
foreach($this->contentMenuAdd as $key => $var)
{
- if(key_exists(OpenVCP::currentLocale(), $var))
+ /*if(key_exists(OpenVCP::currentLocale(), $var))
{
$this->contentMenu .= "<li><a href=\"" . OpenVCP::makeURL(str_replace('\\', '/', str_replace(OPENVCP_MODS_DIR . DIRECTORY_SEPARATOR, '', $dir))) . ($key != "" ? '/' . $key : '' ) . "\"> " . $var[OpenVCP::currentLocale()] . "</a></li>\n";
}
- else if(key_exists('sub', $var))
- {
- $this->contentMenu .= "<li ".$var['sub']."><a href=\"" . OpenVCP::makeURL(str_replace('\\', '/', str_replace(OPENVCP_MODS_DIR . DIRECTORY_SEPARATOR, '', $dir))) . ($key != "" ? '/' . $key : '' ) . "\"> " . $var['en_EN'] . "</a></li>\n";
+ else*/
+ if(key_exists('sub', $var))
+ {
+ $this->contentMenu .= "<li ".$var['sub']."> <a href=\"" . OpenVCP::makeURL(str_replace('\\', '/', str_replace(OPENVCP_MODS_DIR . DIRECTORY_SEPARATOR, '', $dir))) . ($key != "" ? '/' . $key : '' ) . "\"> " . $var['en_EN'] . "</a></li>\n";
}
else if(key_exists('en_EN', $var))
{
@@ -361,21 +368,31 @@
}
else if(key_exists('head', $var))
{
- $this->contentMenu .= "<li>".$var['head']."</li>\n";
+
+ if($var['size'] == 0)
+ {
+ if($headOpen) { $this->contentMenu .= "</div></div>"; $headOpen = false; }
+ $this->contentMenu .= "<div class='menuHeadBox'><div class='menuHeadBox_head'> "; $headOpen = true;
+
+ }
+ $this->contentMenu .= $var['head'];
+ if($var['size'] == 0) $this->contentMenu .= "</div><div class='menuHeadBox_body'>";
}
else
{
$this->contentMenu .= "<li><a href=\"" . OpenVCP::makeURL(str_replace('\\', '/', str_replace(OPENVCP_MODS_DIR . DIRECTORY_SEPARATOR, '', $dir))) . '/' . $key . "\"> " . $var . "</a></li>\n";
}
}
+
+ if($headOpen) { $this->contentMenu .= "</div>"; $headOpen = false; }
}
$auth = & OpenVCP::call('Auth', 'getReference');
if(@$auth->user_information['is_admin'])
{
$PARAMS =& OpenVCP::getParams();
- $this->contentMenu .= "<li><h2 class=\"subMenu0\">"._("search")."</h2></li>\n";
- $this->contentMenu .= "<form method='POST' action=\"".OpenVCP::makeURL("super/search/submit")."\">";
- $this->contentMenu .= "<li><input value='".@$_POST['term']."' name=term type=text class=\"subMenu1\" style=\"width:80px;\"><input name=submit type=submit value=go></form></li>";
+ $this->infoMenu .= "<h4 class=\"subMenu0\">"._("search")."</h4>\n";
+ $this->infoMenu .= "<form method='POST' action=\"".OpenVCP::makeURL("super/search/submit")."\">";
+ $this->infoMenu .= "<input value='".@$_POST['term']."' name=term type=text class=\"subMenu1\" style=\"width:60px;\"><input name=submit type=submit value=go></form>";
}
return true;
}
@@ -416,7 +433,7 @@
*/
public function addContentMenuHead($text, $size = 2, $margin = 0)
{
- $this->contentMenuAdd[] = array('head' => "<h" . $size . " class=\"subMenu$margin\">$text</h" . $size . ">");
+ $this->contentMenuAdd[] = array('head' => "<h" . $size . " class=\"subMenu$margin\">$text</h" . $size . ">", 'size'=>$margin);
return true;
}
@@ -588,6 +605,11 @@
$this->contentData = str_replace("{eId" . $element . "}", "<img src=" . OpenVCP::getWebPath(true) . DIRECTORY_SEPARATOR . str_replace("/".$subpattern[0], '', str_replace('\\', '/', str_replace(OPENVCP_MODS_DIR . DIRECTORY_SEPARATOR, '', OpenVCP::calledMod())))."/graph/" . $name . ">{eId" . $element . "}", $this->contentData);
}
}
+
+ public function getTemplateDir()
+ {
+ return (OpenVCP::getWebPath() . DIRECTORY_SEPARATOR . $this->config['relPath'].DIRECTORY_SEPARATOR.$this->templateName.DIRECTORY_SEPARATOR);
+ }
/**
* Creates a div tag
@@ -693,9 +715,9 @@
$inputbox = "<input type=\"" . $type . "\" name=\"" . $name . "\" ";
if($params != null)
{
- foreach($params as $key => $value)
+ foreach($params as $key => $ovalue)
{
- $inputbox .= "$key=\"$value\" ";
+ $inputbox .= "$key=\"$ovalue\" ";
}
}
$inputbox .= "value=\"$value\"";
Modified: trunk/webinterface/core/OpenVCP.php
===================================================================
--- trunk/webinterface/core/OpenVCP.php 2008-12-29 19:49:08 UTC (rev 637)
+++ trunk/webinterface/core/OpenVCP.php 2008-12-29 19:52:19 UTC (rev 638)
@@ -169,12 +169,12 @@
self::$mainConfig = $mainConfig;
self::$localeDir = $mainConfig['localeDir'];
self::$webPath = $mainConfig['webPath'];
-
+
self::$currentLocale = $mainConfig['defaultLocale'];
@setlocale(LC_MESSAGES, $mainConfig['defaultLocale']);
putenv("LANG=" . $mainConfig['defaultLocale']);
bindtextdomain('core', $mainConfig['localeDir']);
- bind_textdomain_codeset('core', 'iso-8859-15');
+ bind_textdomain_codeset('core', 'utf-8');
register_shutdown_function(array('OpenVCP', 'shutdown'));
$call = preg_replace('/\//', DIRECTORY_SEPARATOR, preg_replace('/^.*?(index\.php\/)\/?(.*)$/', '\\2', $_SERVER['REQUEST_URI']));
@@ -245,7 +245,7 @@
putenv("LANG=".$mainConfig['defaultLocale']);
}
bindtextdomain($domain, $mainConfig['localeDir']);
- #bind_textdomain_codeset($domain, 'iso-8859-1');
+ bind_textdomain_codeset($domain, 'utf-8');
textdomain($domain);
$mainMod = explode("/", self::calledMod(true));
Modified: trunk/webinterface/mods/super/customers/main.php
===================================================================
--- trunk/webinterface/mods/super/customers/main.php 2008-12-29 19:49:08 UTC (rev 637)
+++ trunk/webinterface/mods/super/customers/main.php 2008-12-29 19:52:19 UTC (rev 638)
@@ -33,7 +33,8 @@
require_once("CustomerFactory.class.php");
require_once("VserverFactory.class.php");
-
+require_once("Sendmail.class.php");
+
if(@$PARAMS[0] == "vserver")
OpenVCP::gotoURL("super/vservers/info/".$PARAMS[1]);
@@ -49,6 +50,33 @@
if($customer == null)
OpenVCP::gotoURL("super/customers");
+ if($PARAMS[1] == "newlogin")
+ {
+ $password = createPassword(8);
+
+ try
+ {
+ $mail = new Sendmail("add_customer", $USERINFO['id']);
+ $content['firstname'] = $customer->getFirstname();
+ $content['lastname'] = $customer->getLastname();
+ $admin = AdminFactory::getInstance()->getUserByID($USERINFO['id']);
+ $content['url'] = $admin->getSetting("url");
+ $content['loginname'] = $customer->getLoginname();
+ $content['password'] = $password;
+ $mail->setTo($customer->getEmailaddress());
+ $mail->replaceContent($content);
+ $mail->sendMail();
+
+ $DB->update($DB->table_user, array('password' => md5($password)), array('id' => $customer->getId()));
+ $GUI->p(_("send mail to ")." ".$customer->getLoginname().' '._('sucessfully !'));
+ }
+ catch(Exception $e)
+ {
+ $GUI->p("Error: ".$e->getMessage());
+ return;
+ }
+ }
+ else
if($PARAMS[1] == "email")
{
$ok = false;
@@ -79,7 +107,7 @@
}
else if($ok)
{
- require_once("Sendmail.class.php");
+
$GUI->p(_("sending mail to")." ".$customer->getLoginname());
$mail = new Sendmail("", $USERINFO['id']);
$mail->setTo($customer->getEmailaddress());
@@ -145,12 +173,16 @@
$GUI->br($colum);
$row = $GUI->tableAddRow($table);
- $colum = $GUI->tableAddCol($row, "");
+ //$colum = $GUI->tableAddCol($row, "");
$colum = $GUI->tableAddCol($row, "");
$form = $GUI->form($colum, "email", $PARAMS[0]."/email");
$GUI->formAddInputElement($form, "submit", "email", _("mail to user"));
+
+ $colum = $GUI->tableAddCol($row, "");
+ $form = $GUI->form($colum, "email", $PARAMS[0]."/newlogin");
+ $GUI->formAddInputElement($form, "submit", "email", _("send new login information"), array('onClick'=>"return confirm('"._('Do you really want to reset the password of this customer ?')."');"));
Modified: trunk/webinterface/mods/super/main.php
===================================================================
--- trunk/webinterface/mods/super/main.php 2008-12-29 19:49:08 UTC (rev 637)
+++ trunk/webinterface/mods/super/main.php 2008-12-29 19:52:19 UTC (rev 638)
@@ -101,4 +101,7 @@
$row = $GUI->tableAddRow($table);
$GUI->tableAddCol($row, _("php tls support").": ");
$GUI->tableAddCol($row, function_exists('gnutls_session_new') ? _("yes") : _("no"));
+$row = $GUI->tableAddRow($table);
+$GUI->tableAddCol($row, _("php gd support").": ");
+$GUI->tableAddCol($row, function_exists('ImageCreate') ? _("yes") : _("no"));
?>
Modified: trunk/webinterface/mods/super/nodes/control.php
===================================================================
--- trunk/webinterface/mods/super/nodes/control.php 2008-12-29 19:49:08 UTC (rev 637)
+++ trunk/webinterface/mods/super/nodes/control.php 2008-12-29 19:52:19 UTC (rev 638)
@@ -37,13 +37,15 @@
require_once('NodeFactory.class.php');
require_once('AdminFactory.class.php');
-include "navi.php";
+
$AUTH->getPrivileges('manage_nodes') == 'n' ? OpenVCP::gotoURL("super/nodes") : "";
$GUI->title(_("Control node"));
$node = NodeFactory::getNodeFactory()->getNodeByName(urldecode($PARAMS[0]));
+include "navi.php";
+
if(!($SOCKET->socket_connect($node->getId()))) OpenVCP::gotoURL("super/nodes");
if(!in_array('submit',$PARAMS))
Modified: trunk/webinterface/mods/super/search.php
===================================================================
--- trunk/webinterface/mods/super/search.php 2008-12-29 19:49:08 UTC (rev 637)
+++ trunk/webinterface/mods/super/search.php 2008-12-29 19:52:19 UTC (rev 638)
@@ -157,6 +157,7 @@
$GUI->tableAddCol($row, _("node"));
$GUI->tableAddCol($row, _("customer"));
$GUI->tableAddCol($row, _("state"));
+
if(is_array($vservers)) {
foreach($vservers as $vserver) {
$vs = VserverFactory::getInstance()->getVserverByID($vserver['vserverid']);
@@ -170,4 +171,4 @@
else
$GUI->p(_("no vservers found"));
}
-?>
\ No newline at end of file
+?>
Modified: trunk/webinterface/mods/super/settings/navi.php
===================================================================
--- trunk/webinterface/mods/super/settings/navi.php 2008-12-29 19:49:08 UTC (rev 637)
+++ trunk/webinterface/mods/super/settings/navi.php 2008-12-29 19:52:19 UTC (rev 638)
@@ -22,7 +22,7 @@
* @package OpenVCP-v0.4
*/
- $GUI->addContentMenuHead(_("settings"));
+ $GUI->addContentMenuHead(_("preferences"));
if($AUTH->getPrivileges('modify_global_settings') == 'y')
{
@@ -47,7 +47,7 @@
}
$GUI->addContentMenuSpace();
- $GUI->addContentMenuHead(_("mail templates"), 3);
+ $GUI->addContentMenuHead(_("mail templates"));
$GUI->addContentMenuSub("mail",_("mail templates"), 2);
$GUI->addContentMenuSub("mail/add", _("add template"), 2);
Modified: trunk/webinterface/mods/user/main.php
===================================================================
--- trunk/webinterface/mods/user/main.php 2008-12-29 19:49:08 UTC (rev 637)
+++ trunk/webinterface/mods/user/main.php 2008-12-29 19:52:19 UTC (rev 638)
@@ -114,7 +114,8 @@
}
else
{
- $table = $GUI->table();
+ $f = $GUI->fieldset(_("overview"));
+ $table = $GUI->table($f);
$GUI->h(_("customer data"), 2, $GUI->tableAddCol($GUI->tableAddRow($table), "", 2));
$row = $GUI->tableAddRow($table);
$GUI->tableAddCol($row, _("company").":");
Added: trunk/webinterface/themes/default/cube.png
===================================================================
(Binary files differ)
Property changes on: trunk/webinterface/themes/default/cube.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/webinterface/themes/default/theme.css
===================================================================
--- trunk/webinterface/themes/default/theme.css 2008-12-29 19:49:08 UTC (rev 637)
+++ trunk/webinterface/themes/default/theme.css 2008-12-29 19:52:19 UTC (rev 638)
@@ -98,13 +98,15 @@
margin:0;
padding-top:0;
min-height:80%;
+ width: 100%;
}
div#menu {
clear:both;
- float: left; width: 199px;
+ float: left;
margin: 0;
padding-top: 1em;
+
padding-bottom: 1em;
min-height:500px;
background-image: url(menubar.png);
@@ -112,29 +114,39 @@
padding-bottom: 20000px;
margin-bottom: -20000px;
border-right:1px solid silver;
+ width: 150px;
}
+
+
+
* html div#menu {
height:450px;
- margin-right:-3px;
+
}
div#menu ul{
- width:75%;
- font-size: 0.73em;
+ width:85%;
+ font-size: 0.73em;
+ margin-left: 0px;
+ padding-left: 5px;
}
+
+
div#menu li {
- list-style: none;
- margin: 0; padding: 0.1em;
- font-size: 1em;
+ list-style-image: url(cube.png);
+ marker-offset: 15px;
+ margin: 0; padding: 0.1em;
+ font-size: 1em;
+ padding-left: 0px;
+
}
div#menu h2 {
- font-size: 1.5em;
- margin: 0;
- background-color: #F3F3F3;
- border:1px solid #888888;
- margin: 0.3em;
+ margin-top: 2px;
+ padding-top:5px;
+ padding-left: 5px;
+ font-size: 14px;
}
div#menu h3 {
@@ -151,7 +163,6 @@
div#menu a {
display: block;
- padding: 0.1em;
font-weight: bold;
background-color: #F3F3F3;
border:1px solid #F3F3F3;
@@ -173,23 +184,41 @@
}
-
div#menu .subMenu0 {
margin-left:0px;
}
div#menu .subMenu1 {
- margin-left:20px;
+ margin-left:10px;
+
}
div#menu .subMenu2 {
- margin-left:40px;
+ margin-left:30px;
}
div#menu .subMenu3 {
- margin-left:60px;
+ margin-left:50px;
}
div#menu .subMenu4 {
- margin-left:80px;
+ margin-left:70px;
}
+div.menuHeadBox
+{
+
+ width: 140px;
+
+ padding: 5px;
+ margin: 10px;
+ margin-left: 0px;
+
+}
+
+
+.menuHeadBox_head
+{
+ background: transparent url(box.png) no-repeat;
+ height: 40px;
+}
+
div#content {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
@@ -200,6 +229,8 @@
text-align:center;
min-height:75%;
border-spacing:0px;
+
+
}
* html div#content {
@@ -264,7 +295,7 @@
border:1px solid #000000;
border-spacing:0px;
border-collapse:separate;
- width: 70%;
+ width: 80%;
}
#auth1200 {
@@ -286,7 +317,7 @@
div#content fieldset {
margin:auto;
width:90%;
- -moz-border-radius: 8px;
+ -moz-border-radius: 8px;
}
div#content legend {
@@ -305,7 +336,7 @@
padding: 5px;
vertical-align: middle;
background-color: #C7C5C5;
- width: 98%;
+ width: 80%;
height: 200px;
margin-bottom: 0px;
margin-left: 0px;
Modified: trunk/webinterface/themes/default/theme.html
===================================================================
--- trunk/webinterface/themes/default/theme.html 2008-12-29 19:49:08 UTC (rev 637)
+++ trunk/webinterface/themes/default/theme.html 2008-12-29 19:52:19 UTC (rev 638)
@@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>OpenVCP | {TITLE}</title>
<link href="theme.css" rel="stylesheet" type="text/css" />
{JAVASCRIPT}
@@ -22,15 +22,19 @@
</div>
<div id="contentFrame">
<div id="menu">
+ {INFOMENU}
{CONTENTMENU}
</div>
-
+
+
<div id="content">
{DEBUG} {CONTENT}
</div>
+
+
</div>
<p id="footer">
- <a href="http://www.openvcp.org">openVCP</a> © 2006-2008 by openvcp
+ <a href="http://www.openvcp.org">openVCP</a> © 2006-2008 by openvcp team
</p>
</div>
</body>
More information about the Commits
mailing list