Commit 7f170620 authored by Leigh Stoller's avatar Leigh Stoller

Bug fixes.

parent 7397b481
......@@ -49,7 +49,7 @@ function Do_Search()
if (!$isadmin) {
if (isset($ajax_args["target_user"])) {
$target_user = User::LookupByUid(ajax_args["target_user"]);
$target_user = User::LookupByUid($ajax_args["target_user"]);
if (!$target_user) {
SPITAJAX_ERROR(1, "No such user");
return;
......@@ -60,7 +60,7 @@ function Do_Search()
}
}
elseif (isset($ajax_args["target_project"])) {
$target_project = Project::LookupByPid(ajax_args["target_project"]);
$target_project = Project::LookupByPid($ajax_args["target_project"]);
if (!$target_project) {
SPITAJAX_ERROR(1, "No such project");
return;
......@@ -73,6 +73,9 @@ function Do_Search()
return;
}
}
else {
$target_user = $this_user;
}
}
$whereclause = "";
......
......@@ -44,7 +44,7 @@ $this_user = CheckLoginOrRedirect();
$isadmin = (ISADMIN() || ISFOREIGN_ADMIN() ? 1 : 0);
SPITHEADER(1);
if (!(ISADMIN() || ISFOREIGN_ADMIN())) {
if (!$isadmin) {
if (isset($target_user)) {
if (!$target_user->SameUser($this_user)) {
SPITUSERERROR("Not enough permission to view this page!");
......@@ -65,7 +65,7 @@ if (!(ISADMIN() || ISFOREIGN_ADMIN())) {
# Allow for targeted searches
#
if (isset($target_user)) {
$target_idx = $target_user->idx();
$target_uid = $target_user->uid();
}
elseif (isset($target_project)) {
$target_pid = $target_project->pid_idx();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment