[opw-web] mod_view_projects: Fix checks for applying as student/mentor
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [opw-web] mod_view_projects: Fix checks for applying as student/mentor
- Date: Fri, 21 Mar 2014 13:38:41 +0000 (UTC)
commit e2b4cd709b493311f44ec3aa4b749cf2b095feb7
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Fri Mar 21 09:36:54 2014 -0400
mod_view_projects: Fix checks for applying as student/mentor
Make the checks use project_permissions instead of local out-of-sync
logic.
modules/mod_view_projects.php | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/modules/mod_view_projects.php b/modules/mod_view_projects.php
index 1cca451..30c9beb 100644
--- a/modules/mod_view_projects.php
+++ b/modules/mod_view_projects.php
@@ -877,8 +877,8 @@ else if ($action == 'apply')
$new_role = $category == 'student' ? 's' : 'i';
// Allow setting new role based on deadlines
- $user->restrict(($new_role == 's' && $core->timestamp < $program_data['dl_student']) ||
- ($new_role == 'i' && $core->timestamp < $program_data['dl_mentor']));
+ $user->restrict(($new_role == 's' && $project_permissions->can_apply_student) ||
+ ($new_role == 'i' && $project_permissions->can_apply_mentor));
$params['role'] = $new_role;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]