# # # add_dir "sessions" # # patch "README" # from [c66843122901d904dc11f75fd54f9e64b3bc7950] # to [af03b1a21ca96add94672174b6e6e25ae16e4af2] # # patch "www/common.php" # from [bbc7521adf962914983c9ac5dd801693075f9461] # to [bccf61037f60c547d1dc39bb1f51fa2df032aa59] # # patch "www/index.php" # from [c13794fe13c9178b6da873f0a6114d4507703a1e] # to [4f61c32187241b186bdeb54201a0156477ef2e19] # ============================================================ --- README c66843122901d904dc11f75fd54f9e64b3bc7950 +++ README af03b1a21ca96add94672174b6e6e25ae16e4af2 @@ -16,6 +16,7 @@ www/ Make this accessible to your webserver www/viewmtn/ viewmtn install, modified slightly +sessions/ A directory where session cookie files are saved. projects/*/ Project-specific (internal) www/projects/*/ Project-specific (web-available) graphs/ viewmtn graph cache ============================================================ --- www/common.php bbc7521adf962914983c9ac5dd801693075f9461 +++ www/common.php bccf61037f60c547d1dc39bb1f51fa2df032aa59 @@ -12,16 +12,18 @@ $pattern = "$firstkey|$key|$hex|$str"; preg_match_all("/$pattern/", $conf, $splitconf, PREG_SET_ORDER); -foreach ($splitconf as &$i) { - $i = preg_replace('/^\s*/', '', $i[0]); -} + function nxt(&$arr) { $foo = each($arr); - return preg_replace('/["[](.*)[\]"]/', '$1', $foo['value']); + return preg_replace('/^\s*["[](.*)[\]"]\s*$/', '$1', $foo['value'][0]); } reset($splitconf); while($v = each($splitconf)) { - $i = $v['value']; + $i = $v['value'][0]; + $i = preg_replace("/\n+\$/", '', $i); + $i = preg_replace("/^\n+/", '', $i); + $i = preg_replace('/^\s+/', '', $i); + $i = preg_replace('/\s+$/', '', $i); if($i[0]=='"'||$i[0]=='[') continue; if($i == "userpass") { @@ -35,6 +37,8 @@ $dbstring = nxt($splitconf); } elseif($i == "hostkey") { $hostkey = nxt($splitconf); + } elseif($i == "hostkeypass") { + $hostkeypass = nxt($splitconf); } elseif($i == "admin") { # addr:port list($adminaddr, $adminport) = split(":", nxt($splitconf)); @@ -48,7 +52,7 @@ $json = new Services_JSON(); function mktok($username, $shapass, $t) { - $secfile = dirname(__FILE__) . "/../secfile"; + $secfile = dirname(__FILE__) . "/../sessions/secfile"; if (!is_file($secfile)) { $dat = ""; foreach (array("/dev/random", "/dev/urandom") as $fn) { ============================================================ --- www/index.php c13794fe13c9178b6da873f0a6114d4507703a1e +++ www/index.php 4f61c32187241b186bdeb54201a0156477ef2e19 @@ -18,7 +18,8 @@