|
From: FlorinCB <ory...@us...> - 2009-06-11 08:16:00
|
Update of /cvsroot/mxbb/mx_radiocast/radiocast_mod In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv17130/radiocast_mod Modified Files: radiocast_functions.php Log Message: some fixes for permissions. Index: radiocast_functions.php =================================================================== RCS file: /cvsroot/mxbb/mx_radiocast/radiocast_mod/radiocast_functions.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** radiocast_functions.php 22 Jan 2009 08:29:51 -0000 1.2 --- radiocast_functions.php 11 Jun 2009 08:15:56 -0000 1.3 *************** *** 32,36 **** function radiocast_user_access($cat_id, $passed_auth = 0, $view_check, $upload_check, $rate_check, $comment_check, $edit_check, $delete_check) { ! global $db, $radiocast_config, $userdata; // -------------------------------- --- 32,36 ---- function radiocast_user_access($cat_id, $passed_auth = 0, $view_check, $upload_check, $rate_check, $comment_check, $edit_check, $delete_check) { ! global $db, $radiocast_config, $phpbb_auth, $userdata, $mx_user, $mx_page; // -------------------------------- *************** *** 68,76 **** // // -------------------------------- ! // If the current user is an ADMIN (RADIOCAST_ADMIN == ADMIN) // -------------------------------- ! if ($userdata['user_level'] == ADMIN) { for ($i = 0; $i < count($radiocast_user_access); $i++) --- 68,86 ---- // + // + // Authorization SQL + // + $phpbb_auth->acl($mx_user->data); // Do only once, in user_init // Move later + + $auth_data_sql = $phpbb_auth->get_auth_forum(); + + // + // End Auth Check + // // -------------------------------- ! // If the current user is an MODERATOR // -------------------------------- ! if ( $mx_page->auth_mod ) { for ($i = 0; $i < count($radiocast_user_access); $i++) *************** *** 86,96 **** // // END check ADMIN ! // ! // -------------------------------- ! // if this is a GUEST, we will ignore some checking // -------------------------------- ! if (!$userdata['session_logged_in']) { $edit_check = 0; --- 96,135 ---- // // END check ADMIN ! // ! // -------------------------------- ! // If the current user is an ADMIN (RADIOCAST_ADMIN == ADMIN) // -------------------------------- ! if ( ($userdata['user_level'] == ADMIN) ) ! { ! $radiocast_user_access = array( ! 'view' => 1, ! 'upload' => 1, ! 'rate' => 1, ! 'comment' => 1, ! 'edit' => 1, ! 'delete' => 1, ! 'moderator' => 1 ! ); ! ! $radiocast_user_access_keys = array_keys($radiocast_user_access); ! ! for ($i = 0; $i < count($radiocast_user_access); $i++) ! { ! $radiocast_user_access[$radiocast_user_access_keys[$i]] = 1; // Authorised All ! } ! ! // ! // Function EXIT here ! // ! return $radiocast_user_access; ! } ! // ! // END check ADMIN ! // ! ! ! if ( empty($auth_data_sql) ) { $edit_check = 0; *************** *** 98,105 **** $moderator_check = 0; } ! // ! // END check GUEST ! // ! // -------------------------------- --- 137,148 ---- $moderator_check = 0; } ! else ! { ! $view_check = 1; ! $upload_check =1; ! $edit_check = 0; ! $delete_check = 0; ! $moderator_check = 0; ! } // -------------------------------- |