index 21813350df90975a6d736eae9f2b96a658cba1d3..48cb40e9289dac6a85d39f773678cac81834e353 100644 (file)
/* Bail out if we have login restrictions set, for security reasons
the message is the same than failed user/pw */
if (!$ui->loginAllowed()){
/* Bail out if we have login restrictions set, for security reasons
the message is the same than failed user/pw */
if (!$ui->loginAllowed()){
+ new log("security","login","",array(),"Login restriction for user \"$username\", login not permitted");
return (NULL);
}
return (NULL);
}
/* Bail out if we have login restrictions set, for security reasons
the message is the same than failed user/pw */
if (!$ui->loginAllowed()){
/* Bail out if we have login restrictions set, for security reasons
the message is the same than failed user/pw */
if (!$ui->loginAllowed()){
+ new log("security","login","",array(),"Login restriction for user \"$username\", login not permitted");
return (NULL);
}
return (NULL);
}
{
if (session::global_is_set('size_limit') && session::global_get('size_limit') >= 10000000 ||
(session::is_set('limit_exceeded') && session::get('limit_exceeded'))){
{
if (session::global_is_set('size_limit') && session::global_get('size_limit') >= 10000000 ||
(session::is_set('limit_exceeded') && session::get('limit_exceeded'))){
- $config= "<input type='submit' name='edit_sizelimit' value="._("Configure").">";
+ $config= "<button type='submit' name='edit_sizelimit'>"._("Configure")."</button>";
} else {
$config= "";
}
} else {
$config= "";
}
* \param int 'percentage' Value to display
* \param int 'width' width of the resulting output
* \param int 'height' height of the resulting output
* \param int 'percentage' Value to display
* \param int 'width' width of the resulting output
* \param int 'height' height of the resulting output
- * \param boolean 'showvalue' weither to show the percentage in the progressbar or not
+ * \param boolean 'showtext' weither to show the percentage in the progressbar or not
* */
* */
-function progressbar($percentage,$width=100,$height=15,$showvalue=false)
+function progressbar($percentage, $width= 200, $height= 14, $showText= false, $colorize= true, $id= "")
{
{
- return("<img src='progress.php?x=$width&y=$height&p=$percentage'>");
+ $text= "";
+ $class= "";
+ $style= "width:${width}px;height:${height}px;";
+
+ // Fix percentage range
+ $percentage= floor($percentage);
+ if ($percentage > 100) {
+ $percentage= 100;
+ }
+ if ($percentage < 0) {
+ $percentage= 0;
+ }
+
+ // Only show text if we're above 10px height
+ if ($showText && $height>10){
+ $text= $percentage."%";
+ }
+
+ // Set font size
+ $style.= "font-size:".($height-3)."px;";
+
+ // Set color
+ if ($colorize){
+ if ($percentage < 70) {
+ $class= " progress-low";
+ } elseif ($percentage < 80) {
+ $class= " progress-mid";
+ } elseif ($percentage < 90) {
+ $class= " progress-high";
+ } else {
+ $class= " progress-full";
+ }
+ }
+
+ // Apply gradients
+ $hoffset= floor($height / 2) + 4;
+ $woffset= floor(($width+5) * (100-$percentage) / 100);
+ foreach (array("-moz-box-shadow", "-webkit-box-shadow", "box-shadow") as $type) {
+ $style.="$type:
+ 0 0 2px rgba(255, 255, 255, 0.4) inset,
+ 0 4px 6px rgba(255, 255, 255, 0.4) inset,
+ 0 ".$hoffset."px 0 -2px rgba(255, 255, 255, 0.2) inset,
+ -".$woffset."px 0 0 -2px rgba(255, 255, 255, 0.2) inset,
+ -".($woffset+1)."px 0 0 -2px rgba(0, 0, 0, 0.6) inset,
+ 0pt ".($hoffset+1)."px 8px rgba(0, 0, 0, 0.3) inset,
+ 0pt 1px 0px rgba(0, 0, 0, 0.2);";
+ }
+
+ // Set ID
+ if ($id != ""){
+ $id= "id='$id'";
+ }
+
+ return "<div class='progress$class' $id style='$style'>$text</div>";
}
}
@@ -2808,6 +2863,7 @@ function get_languages($languages_in_own_language = FALSE,$strip_region_tag = FA
"en_US" => "English",
"nl_NL" => "Dutch",
"pl_PL" => "Polish",
"en_US" => "English",
"nl_NL" => "Dutch",
"pl_PL" => "Polish",
+ "pt_BR" => "Brazilian Portuguese",
#"sv_SE" => "Swedish",
"zh_CN" => "Chinese",
"vi_VN" => "Vietnamese",
#"sv_SE" => "Swedish",
"zh_CN" => "Chinese",
"vi_VN" => "Vietnamese",
@@ -2821,6 +2877,7 @@ function get_languages($languages_in_own_language = FALSE,$strip_region_tag = FA
"en_US" => _("English"),
"nl_NL" => _("Dutch"),
"pl_PL" => _("Polish"),
"en_US" => _("English"),
"nl_NL" => _("Dutch"),
"pl_PL" => _("Polish"),
+ "pt_BR" => _("Brazilian Portuguese"),
#"sv_SE" => _("Swedish"),
"zh_CN" => _("Chinese"),
"vi_VN" => _("Vietnamese"),
#"sv_SE" => _("Swedish"),
"zh_CN" => _("Chinese"),
"vi_VN" => _("Vietnamese"),
/* Return an image description using the path */
/* Return an image description using the path */
-function image($path, $label= null, $action= "", $title= "", $align= "middle")
+function image($path, $action= "", $title= "", $align= "middle")
{
global $config;
global $BASE_DIR;
{
global $config;
global $BASE_DIR;
+ $label= null;
// Bail out, if there's no style file
if(!session::global_is_set("img-styles")){
// Bail out, if there's no style file
if(!session::global_is_set("img-styles")){
@@ -3544,6 +3602,11 @@ function image($path, $label= null, $action= "", $title= "", $align= "middle")
}
$styles= session::global_get('img-styles');
}
$styles= session::global_get('img-styles');
+ /* Extract labels from path */
+ if (preg_match("/\.png\[(.*)\]$/", $path, $matches)) {
+ $label= $matches[1];
+ }
+
$lbl= "";
if ($label) {
if (isset($styles["images/label-".$label.".png"])) {
$lbl= "";
if ($label) {
if (isset($styles["images/label-".$label.".png"])) {
@@ -3551,6 +3614,8 @@ function image($path, $label= null, $action= "", $title= "", $align= "middle")
} else {
die("Invalid label specified: $label\n");
}
} else {
die("Invalid label specified: $label\n");
}
+
+ $path= preg_replace("/\[.*\]$/", "", $path);
}
// Non middle layout?
}
// Non middle layout?
@@ -3572,6 +3637,5 @@ function image($path, $label= null, $action= "", $title= "", $align= "middle")
}
}
-
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>