[slbackup-commit] CVS update: slbackup-php/src functions.php
index.php
finnarne-guest at alioth.debian.org
finnarne-guest at alioth.debian.org
Wed Apr 18 06:30:41 UTC 2007
User: finnarne-guest
Date: 07/04/18 06:30:41
Modified: src functions.php index.php
Log:
make the use possibility of using the application without https an option
Revision Changes Path
1.6 +12 -1 slbackup-php/src/functions.php
Index: functions.php
===================================================================
RCS file: /cvsroot/slbackup/slbackup-php/src/functions.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- functions.php 14 Apr 2007 05:19:34 -0000 1.5
+++ functions.php 18 Apr 2007 06:30:41 -0000 1.6
@@ -20,10 +20,11 @@
function loadConfig () {
global $backuphost, $backupuser, $backupconf, $backupcron,
- $ssh_options, $logfile, $smarty_templ, $smarty_compile ;
+ $ssh_options, $logfile, $nonhttps, $smarty_templ, $smarty_compile ;
@include_once ("/etc/slbackup/config.php") ;
+ if (empty ($nonhttps)) $nonhttps = $_COOKIE ['nonhttps'] ;
if (empty ($smarty_templ)) $smarty_templ = $_COOKIE ['smarty_templ'] ;
if (empty ($smarty_compile)) $smarty_compile = $_COOKIE ['smarty_compile'] ;
@@ -34,6 +35,16 @@
if (empty ($ssh_options)) $ssh_options="-o StrictHostKeyChecking=no" ;
if (empty ($logfile)) $logfile="/var/log/slbackup/slbackup.log" ;
+ switch ($nonhttps) {
+ case "warn":
+ case "allow":
+ case "deny":
+ break ;
+ default:
+ $nonhttps = "warn"
+ setcookie ('nonhttps', $nonhttps) ;
+ break ;
+ }
if (empty ($smarty_templ)) {
$smarty_templ = realpath ("../templates") ;
1.29 +2 -2 slbackup-php/src/index.php
Index: index.php
===================================================================
RCS file: /cvsroot/slbackup/slbackup-php/src/index.php,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- index.php 18 Apr 2007 05:58:55 -0000 1.28
+++ index.php 18 Apr 2007 06:30:41 -0000 1.29
@@ -483,8 +483,8 @@
$config = readconf ($passwd) ;
if (empty ($config)) {
- if (!empty ($_SERVER["HTTPS"]))
- $smarty->assign ('https', 'true') ;
+ if (empty ($_SERVER["HTTPS"]))
+ $smarty->assign ('https', $nonhttps) ;
$smarty->assign ('backupuser', $backupuser) ;
$smarty->assign ('backuphost', $backuphost) ;
$smarty->display ('login.tpl') ;
More information about the slbackup-commit
mailing list