Commit eb142980 authored by nextime's avatar nextime

Some user gui limits

parent 0d575713
ALTER TABLE `user_gui_panels` ADD `subpage` VARCHAR( 1024 ) NOT NULL AFTER `page` ,
ADD INDEX ( `subpage` ) ;
ALTER TABLE `users` ADD `configlock` ENUM( 'yes', 'no' ) NOT NULL DEFAULT 'no',
ADD INDEX ( `configlock` ) ;
...@@ -30,7 +30,7 @@ function getSection($path=false) ...@@ -30,7 +30,7 @@ function getSection($path=false)
$GUISECTION="index"; $GUISECTION="index";
if(count($sectar)>1 and $sectar[1]!="") if(count($sectar)>1 and $sectar[1]!="")
$GUISECTION=$sectar[1]; $GUISECTION=$sectar[1];
return $GUISECTION; return mysql_real_escape_string(htmlentities($GUISECTION));
} }
function getSubsection($path=false) function getSubsection($path=false)
...@@ -42,7 +42,7 @@ function getSubsection($path=false) ...@@ -42,7 +42,7 @@ function getSubsection($path=false)
$GUISUBSECTION=""; $GUISUBSECTION="";
if(count($sectar)>2) if(count($sectar)>2)
$GUISUBSECTION=$sectar[2]; $GUISUBSECTION=$sectar[2];
return $GUISUBSECTION; return mysql_real_escape_string(htmlentities($GUISUBSECTION));
} }
function getSubsectionOpt($path=false) function getSubsectionOpt($path=false)
...@@ -54,7 +54,7 @@ function getSubsectionOpt($path=false) ...@@ -54,7 +54,7 @@ function getSubsectionOpt($path=false)
$GUISUBSECTIONOPT=""; $GUISUBSECTIONOPT="";
if(count($sectar)>3) if(count($sectar)>3)
$GUISUBSECTIONOPT=$sectar[3]; $GUISUBSECTIONOPT=$sectar[3];
return $GUISUBSECTIONOPT; return mysql_real_escape_string(htmlentities($GUISUBSECTIONOPT));
} }
$BASEGUIPATH=getBaseGuiPath(); $BASEGUIPATH=getBaseGuiPath();
$FSPATH=getFSPath(); $FSPATH=getFSPath();
...@@ -63,15 +63,6 @@ $GUISECTION=getSection(); ...@@ -63,15 +63,6 @@ $GUISECTION=getSection();
$GUISUBSECTION=getSubsection(); $GUISUBSECTION=getSubsection();
$GUISUBSECTIONOPT=getSubsectionOpt(); $GUISUBSECTIONOPT=getSubsectionOpt();
$left=FALSE;
$right=FALSE;
if(file_exists("$FSPATH/left/$GUISECTION.php"))
{
$left=TRUE;
}
if(file_exists("$FSPATH/right/$GUISECTION.php"))
$right=TRUE;
$dmcolors=array( $dmcolors=array(
'green' => 'success', 'green' => 'success',
'orange' => 'warning', 'orange' => 'warning',
...@@ -112,6 +103,15 @@ switch($_DOMOTIKA['right_bar']) ...@@ -112,6 +103,15 @@ switch($_DOMOTIKA['right_bar'])
default: $RBAR=array('medium','big'); default: $RBAR=array('medium','big');
} }
$left=FALSE;
$right=FALSE;
if(file_exists("$FSPATH/left/$GUISECTION.php") && $_DOMOTIKA['left_bar']!='none')
{
$left=TRUE;
}
if(file_exists("$FSPATH/right/$GUISECTION.php") && $_DOMOTIKA['right_bar']!='none')
$right=TRUE;
$lang=$_DOMOTIKA['language']; $lang=$_DOMOTIKA['language'];
......
...@@ -14,7 +14,7 @@ $DEFPANELS[]=array('panel_title'=>$tr->Get($GUISUBSECTION)." - ".$tr->Get("Outpu ...@@ -14,7 +14,7 @@ $DEFPANELS[]=array('panel_title'=>$tr->Get($GUISUBSECTION)." - ".$tr->Get("Outpu
$DEFPANELS[]=array('panel_title'=>$tr->Get($GUISUBSECTION)." - ".$tr->Get("Inputs"),'panel_sections'=>'input','panel_websections'=>$GUISUBSECTION,'panel_cols'=>4, 'panel_height'=>'100%')+$PANELDEFAULTS+$paneldimensions; $DEFPANELS[]=array('panel_title'=>$tr->Get($GUISUBSECTION)." - ".$tr->Get("Inputs"),'panel_sections'=>'input','panel_websections'=>$GUISUBSECTION,'panel_cols'=>4, 'panel_height'=>'100%')+$PANELDEFAULTS+$paneldimensions;
$DEFPANELS[]=array('panel_title'=>$tr->Get($GUISUBSECTION)." - ".$tr->Get("Analogs"),'panel_sections'=>'analog','panel_websections'=>$GUISUBSECTION,'panel_cols'=>4, 'panel_height'=>'100%')+$PANELDEFAULTS+$paneldimensions; $DEFPANELS[]=array('panel_title'=>$tr->Get($GUISUBSECTION)." - ".$tr->Get("Analogs"),'panel_sections'=>'analog','panel_websections'=>$GUISUBSECTION,'panel_cols'=>4, 'panel_height'=>'100%')+$PANELDEFAULTS+$paneldimensions;
$panels=DB::query("SELECT * FROM user_gui_panels WHERE user='$_DOMOTIKA[username]' AND page='actuations/$GUISUBSECTION' ORDER by panel_position,id"); $panels=DB::query("SELECT * FROM user_gui_panels WHERE user='$_DOMOTIKA[username]' AND page='actuations' and subpage='$GUISUBSECTION' ORDER by panel_position,id");
if(!$panels or count($panels)<1) { if(!$panels or count($panels)<1) {
$panels=$DEFPANELS; $panels=$DEFPANELS;
} }
......
<? <?
@include_once("../includes/common.php"); @include_once("../includes/common.php");
$conflock=DB::queryFirstField("SELECT configlock FROM users WHERE username=%s", $_DOMOTIKA['username'] );
?> ?>
<h1>Settings</h1> <h1>Settings</h1>
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li <? if($GUISUBSECTION=="") {?>class="active"<?}?>><a href="<?=$BASEGUIPATH.'/'.$GUISECTION?>">User options</a></li> <li <? if($GUISUBSECTION=="") {?>class="active"<?}?>><a href="<?=$BASEGUIPATH.'/'.$GUISECTION?>">User options</a></li>
<!-- <li <? if($GUISUBSECTION=="gui") {?>class="active"<?}?>><a href="<?=$BASEGUIPATH.'/'.$GUISECTION?>/gui">GUI options</a></li> --> <!-- <li <? if($GUISUBSECTION=="gui") {?>class="active"<?}?>><a href="<?=$BASEGUIPATH.'/'.$GUISECTION?>/gui">GUI options</a></li> -->
</ul> </ul>
<? if($GUISUBSECTION=="") {?> <? if($conflock=='yes') { ?>
<div>Configuration locked. Cannot change it, sorry</div>
<? } else if($GUISUBSECTION=="") {?>
<div class="formcontainer" > <div class="formcontainer" >
<form id="userform" name="userform" class="form-horizontal" style="display:none;margin-bottom:60px;"> <form id="userform" name="userform" class="form-horizontal" style="display:none;margin-bottom:60px;">
<div class="form-group"> <div class="form-group">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment