handling data from the client properly for gzdecoding and
[gwvp-mini.git] / gwvpmini / gwvpmini_db.php
index d3d1057..88c7ee2 100644 (file)
@@ -95,7 +95,7 @@ function gwvpmini_GetActivityLog($nentries = 20, $forid=-1)
        else return $ret;
 }
 
-
+// TODO: deal with multiple repos from one ownerid
 function gwvpmini_getRepo($ownerid=null, $name=null, $id=null)\r
 {\r
        $conn = gwvpmini_ConnectDB();
@@ -251,7 +251,8 @@ function gwvpmini_GetRepoPerm($rid, $uid)
        \r
        $permsarray = unserialize(base64_decode($cperms_t));
        
-       // error_log("PERMSARRAY: ".print_r($permsarray,true));
+       error_log("PERMSARRAY: with call for $rid and user $uid ".print_r($permsarray,true));
+       
        
        
        $perm = 0;
@@ -370,6 +371,17 @@ function gwvpmini_EnableUser($uid)
 \r
        return $conn->query($sql);\r
 }\r
+
+function gwvpmini_SetRepoCloning($rid)\r
+{\r
+       $conn = gwvpmini_ConnectDB();\r
+\r
+       if($rid < 0) return;\r
+\r
+       $sql = "update repos set repos_status=2 where repos_id='$rid'";\r
+\r
+       return $conn->query($sql);\r
+}\r
 \r
 function gwvpmini_DisableRepo($rid)
 {
@@ -753,13 +765,13 @@ function gwvpmini_setConfigVal($confname, $confval)
        return $conn->query($sql);\r
 }
 
-function gwvpmini_AddRepo($name, $desc, $ownerid, $clonefrom)
+function gwvpmini_AddRepo($name, $desc, $ownerid, $defperms, $clonefrom)
 {
        
        // error_log("addrepo in db for $name, $desc, $ownerid");
        $conn = gwvpmini_ConnectDB();\r
        
-       $perms["b"] = "a";
+       $perms["b"] = $defperms;
        
        $encperms = base64_encode(serialize($perms));