// if its a write, we push for authentication
if($write) {
+ error_log("is write attempt, ask for login");
$person = gwvp_checkBasicAuthLogin();
if($person == false) {
gwvp_AskForBasicAuth();
return;
} else {
- error_log("checking perms for $person against $repoid");
- $perms = gwvp_resolvRepoPerms(gwvp_getUserId($person), $repoid);
+ error_log("checking perms for $person against $repoid for repo $repo");
+ $perms = gwvp_resolvRepoPerms(gwvp_getUserId(null, $person), $repoid);
if($perms < 3) {
+ error_log("perms are $perms and im not allowed");
gwvp_fourZeroThree();
- return;
+ exit(0);
} else {
// here we pass to the git backend
error_log("perms are $perms and im allowed");
gwvp_AskForBasicAuth();
return;
} else {
- $perms = gwvp_resolvRepoPerms(gwvp_getUserId($person), $repoid);
+ $perms = gwvp_resolvRepoPerms(gwvp_getUserId(null, $person), $repoid);
if($perms < 3) {
$dump = print_r($person, true);
error_log("in basic read, called 403 for $perms $dump");
// if we made it this far, we a read and we have permissions to do so, just search the file from the repo
if(file_exists("$repo_base/$repo.git/$newloc")) {
- error_log("would ask $repo,$actual_repo_name for $repo/$newloc from $repo_base/$repo/$newloc");
+ error_log("would ask $repo for $repo.git/$newloc from $repo_base/$repo.git/$newloc");
$fh = fopen("$repo_base/$repo.git/$newloc", "rb");
error_log("pushing file");
$ownerid = gwvp_getRepoOwner($repoid);
$isadmin = gwvp_IsUserAdmin(null, null, $userid);
+ error_log("USerid is $userid, ownerid $ownerid");
+
if($isadmin) return 3;
if($userid == $ownerid) return 3;