|
From: OryNider <ory...@us...> - 2007-10-05 02:34:21
|
Update of /cvsroot/mxbb/mx_smartor/admin In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25894 Modified Files: admin_album_auth.php Log Message: restoring the file from the Beta version :P Index: admin_album_auth.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/admin/admin_album_auth.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** admin_album_auth.php 9 Aug 2007 13:16:48 -0000 1.11 --- admin_album_auth.php 5 Oct 2007 02:34:12 -0000 1.12 *************** *** 4,63 **** * @package mxBB Portal Module - mx_smartor * @version $Id$ ! * @copyright (c) 2003 [sma...@ho..., Smartor] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ ! define('IN_PORTAL', 1); ! if( !empty($setmodules) ) { ! $filename = basename(__FILE__); ! $module['Smartor_Album']['Permissions'] = "modules/mx_smartor/admin/" .$filename; return; } - // // Let's set the root dir for phpBB - // - $module_root_path = '../'; - $mx_root_path = '../../../'; - $phpEx = substr(strrchr(__FILE__, '.'), 1); - require($mx_root_path . 'admin/pagestart.' . $phpEx); - - define('ALBUM_MOD_PATH', 'album_mod/'); - - // Get general album information - if (!isset($album_root_path) || empty($album_root_path)) - { - $album_root_path = $module_root_path . ALBUM_MOD_PATH . ''; - } ! require($album_root_path . 'album_common.'.$phpEx); ! // require($module_root_path . 'album_mod/album_constants.'.$phpEx); // ********************************************************************** // Read language definition // ********************************************************************** ! if ( file_exists( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ) ) ! { ! include( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ); ! } ! else if ( file_exists( $module_root_path . 'language/lang_english/lang_admin.' . $phpEx ) ) { include( $module_root_path . 'language/lang_english/lang_admin.' . $phpEx ); } ! if ( file_exists( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ) ) ! { ! include( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ); ! } ! else if ( file_exists( $module_root_path . 'language/lang_english/lang_main.' . $phpEx ) ) { ! include( $module_root_path . 'language/lang_english/lang_main.' . $phpEx ); } ! if( !isset($HTTP_POST_VARS['submit']) ) { ! // Build the category selector $sql = "SELECT cat_id, cat_title, cat_order FROM ". ALBUM_CAT_TABLE ." --- 4,48 ---- * @package mxBB Portal Module - mx_smartor * @version $Id$ ! * @copyright (c) 2002-2006 [Smartor, Volodymyr (CLowN) Skoryk, IdleVoid, Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ ! /* Powered by Photo Album v2.x.x (c) 2002-2003 Smartor */ ! define( 'IN_PORTAL', 1 ); ! ! if ( !empty( $setmodules ) ) { ! $filename = basename( __FILE__ ); ! $module['Smartor_Album']['Permissions'] = "modules/mx_smartor/admin/" . $filename; return; } // Let's set the root dir for phpBB ! $module_root_path = './../'; ! $mx_root_path = './../../../'; ! $phpEx = substr(strrchr(__FILE__, '.'), 1); ! require( $mx_root_path . 'admin/pagestart.' . $phpEx ); ! include_once( $module_root_path . 'album_mod/album_common.' . $phpEx ); // ********************************************************************** // Read language definition // ********************************************************************** ! if ( !file_exists( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ) ) { include( $module_root_path . 'language/lang_english/lang_admin.' . $phpEx ); } ! else { ! include( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ); } ! $album_user_id = ALBUM_PUBLIC_GALLERY; ! ! if ( !isset( $HTTP_POST_VARS['submit'] ) ) { ! /* // Build the category selector $sql = "SELECT cat_id, cat_title, cat_order FROM ". ALBUM_CAT_TABLE ." *************** *** 80,111 **** ); } ! $template->set_filenames(array( ! 'body' => 'admin/album_cat_select_body.tpl') ! ); ! ! $template->assign_vars(array( 'L_ALBUM_AUTH_TITLE' => $lang['Album_Auth_Title'], 'L_ALBUM_AUTH_EXPLAIN' => $lang['Album_Auth_Explain'], 'L_SELECT_CAT' => $lang['Select_a_Category'], ! 'S_ALBUM_ACTION' => append_sid("admin_album_auth.$phpEx"), ! 'L_LOOK_UP_CAT' => $lang['Look_up_Category']) ! ); ! $template->pparse('body'); ! include($mx_root_path . 'admin/page_footer_admin.'.$phpEx); } else { ! if( !isset($HTTP_GET_VARS['cat_id']) ) { ! $cat_id = intval($HTTP_POST_VARS['cat_id']); ! $template->set_filenames(array( ! 'body' => 'admin/album_auth_body.tpl') ! ); ! $template->assign_vars(array( 'L_ALBUM_AUTH_TITLE' => $lang['Album_Auth_Title'], 'L_ALBUM_AUTH_EXPLAIN' => $lang['Album_Auth_Explain'], --- 65,100 ---- ); } + */ + album_read_tree(); + $s_album_cat_list = album_get_tree_option( ALBUM_ROOT_CATEGORY, ALBUM_AUTH_VIEW, ALBUM_SELECTBOX_INCLUDE_ALL | ALBUM_SELECTBOX_INCLUDE_ROOT ); + // --- Album Category Hierarchy : end + $template->set_filenames( array( 'body' => 'admin/album_cat_select_body.tpl' ) + ); ! $template->assign_vars( array( 'L_ALBUM_AUTH_TITLE' => $lang['Album_Auth_Title'], 'L_ALBUM_AUTH_EXPLAIN' => $lang['Album_Auth_Explain'], 'L_SELECT_CAT' => $lang['Select_a_Category'], ! 'S_ALBUM_ACTION' => append_sid( "admin_album_auth.$phpEx" ), ! 'L_LOOK_UP_CAT' => $lang['Look_up_Category'], ! // --- Album Category Hierarchy : begin ! // --- version : 1.1.0 ! 'CAT_SELECT_TITLE' => $s_album_cat_list ) ! // --- Album Category Hierarchy : end ! ); ! $template->pparse( 'body' ); ! include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); } else { ! if ( !isset( $HTTP_GET_VARS['cat_id'] ) ) { ! $cat_id = intval( $HTTP_POST_VARS['cat_id'] ); ! $template->set_filenames( array( 'body' => 'admin/album_auth_body.tpl' ) ); ! $template->assign_vars( array( 'L_ALBUM_AUTH_TITLE' => $lang['Album_Auth_Title'], 'L_ALBUM_AUTH_EXPLAIN' => $lang['Album_Auth_Explain'], *************** *** 123,220 **** 'L_IS_MODERATOR' => $lang['Is_Moderator'], ! 'S_ALBUM_ACTION' => append_sid("admin_album_auth.$phpEx?cat_id=$cat_id"), ! ) ! ); // Get the list of phpBB usergroups $sql = "SELECT group_id, group_name FROM " . GROUPS_TABLE . " ! WHERE group_single_user <> " . TRUE ." ORDER BY group_name ASC"; ! if ( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not get group list', '', __LINE__, __FILE__, $sql); } ! while( $row = $db->sql_fetchrow($result) ) { $groupdata[] = $row; } // Get info of this cat $sql = "SELECT cat_id, cat_title, cat_view_groups, cat_upload_groups, cat_rate_groups, cat_comment_groups, cat_edit_groups, cat_delete_groups, cat_moderator_groups ! FROM ". ALBUM_CAT_TABLE ." WHERE cat_id = '$cat_id'"; ! if( !$result = $db->sql_query($sql) ) { ! mx_message_die(GENERAL_ERROR, 'Could not get Category information', '', __LINE__, __FILE__, $sql); } ! $thiscat = $db->sql_fetchrow($result); ! $view_groups = @explode(',', $thiscat['cat_view_groups']); ! $upload_groups = @explode(',', $thiscat['cat_upload_groups']); ! $rate_groups = @explode(',', $thiscat['cat_rate_groups']); ! $comment_groups = @explode(',', $thiscat['cat_comment_groups']); ! $edit_groups = @explode(',', $thiscat['cat_edit_groups']); ! $delete_groups = @explode(',', $thiscat['cat_delete_groups']); ! $moderator_groups = @explode(',', $thiscat['cat_moderator_groups']); ! for ($i = 0; $i < count($groupdata); $i++) { ! $template->assign_block_vars('grouprow', array( 'GROUP_ID' => $groupdata[$i]['group_id'], 'GROUP_NAME' => $groupdata[$i]['group_name'], ! ! 'VIEW_CHECKED' => (in_array($groupdata[$i]['group_id'], $view_groups)) ? 'checked="checked"' : '', ! ! 'UPLOAD_CHECKED' => (in_array($groupdata[$i]['group_id'], $upload_groups)) ? 'checked="checked"' : '', ! ! 'RATE_CHECKED' => (in_array($groupdata[$i]['group_id'], $rate_groups)) ? 'checked="checked"' : '', ! ! 'COMMENT_CHECKED' => (in_array($groupdata[$i]['group_id'], $comment_groups)) ? 'checked="checked"' : '', ! ! 'EDIT_CHECKED' => (in_array($groupdata[$i]['group_id'], $edit_groups)) ? 'checked="checked"' : '', ! ! 'DELETE_CHECKED' => (in_array($groupdata[$i]['group_id'], $delete_groups)) ? 'checked="checked"' : '', ! ! 'MODERATOR_CHECKED' => (in_array($groupdata[$i]['group_id'], $moderator_groups)) ? 'checked="checked"' : '') ); } ! $template->pparse('body'); ! include($mx_root_path . 'admin/page_footer_admin.'.$phpEx); } else { ! $cat_id = intval($HTTP_GET_VARS['cat_id']); ! $view_groups = @implode(',', $HTTP_POST_VARS['view']); ! $upload_groups = @implode(',', $HTTP_POST_VARS['upload']); ! $rate_groups = @implode(',', $HTTP_POST_VARS['rate']); ! $comment_groups = @implode(',', $HTTP_POST_VARS['comment']); ! $edit_groups = @implode(',', $HTTP_POST_VARS['edit']); ! $delete_groups = @implode(',', $HTTP_POST_VARS['delete']); ! $moderator_groups = @implode(',', $HTTP_POST_VARS['moderator']); ! $sql = "UPDATE ". ALBUM_CAT_TABLE ." SET cat_view_groups = '$view_groups', cat_upload_groups = '$upload_groups', cat_rate_groups = '$rate_groups', cat_comment_groups = '$comment_groups', cat_edit_groups = '$edit_groups', cat_delete_groups = '$delete_groups', cat_moderator_groups = '$moderator_groups' WHERE cat_id = '$cat_id'"; ! if ( !$result = $db->sql_query($sql) ) { ! mx_message_die(GENERAL_ERROR, 'Could not update Album config table', '', __LINE__, __FILE__, $sql); } ! // okay, return a message... ! $message = $lang['Album_Auth_successfully'] . '<br /><br />' . sprintf($lang['Click_return_album_auth'], '<a href="' . append_sid("admin_album_auth.$phpEx") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid($mx_root_path . "admin/index.$phpEx?pane=right") . '">', '</a>'); ! ! mx_message_die(GENERAL_MESSAGE, $message); } } - - /* Powered by Photo Album v2.x.x (c) 2002-2003 Smartor */ - ?> \ No newline at end of file --- 112,201 ---- 'L_IS_MODERATOR' => $lang['Is_Moderator'], ! 'S_ALBUM_ACTION' => append_sid( "admin_album_auth.$phpEx?cat_id=$cat_id" ), ! )); + // // Get the list of phpBB usergroups + // $sql = "SELECT group_id, group_name FROM " . GROUPS_TABLE . " ! WHERE group_single_user <> " . true . " ORDER BY group_name ASC"; ! if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not get group list', '', __LINE__, __FILE__, $sql ); } ! while ( $row = $db->sql_fetchrow( $result ) ) { $groupdata[] = $row; } + // // Get info of this cat + // $sql = "SELECT cat_id, cat_title, cat_view_groups, cat_upload_groups, cat_rate_groups, cat_comment_groups, cat_edit_groups, cat_delete_groups, cat_moderator_groups ! FROM " . ALBUM_CAT_TABLE . " WHERE cat_id = '$cat_id'"; ! if ( !$result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not get Category information', '', __LINE__, __FILE__, $sql ); } ! $thiscat = $db->sql_fetchrow( $result ); ! $view_groups = @explode( ',', $thiscat['cat_view_groups'] ); ! $upload_groups = @explode( ',', $thiscat['cat_upload_groups'] ); ! $rate_groups = @explode( ',', $thiscat['cat_rate_groups'] ); ! $comment_groups = @explode( ',', $thiscat['cat_comment_groups'] ); ! $edit_groups = @explode( ',', $thiscat['cat_edit_groups'] ); ! $delete_groups = @explode( ',', $thiscat['cat_delete_groups'] ); ! $moderator_groups = @explode( ',', $thiscat['cat_moderator_groups'] ); ! for ( $i = 0; $i < count( $groupdata ); $i++ ) { ! $template->assign_block_vars( 'grouprow', array( 'GROUP_ID' => $groupdata[$i]['group_id'], 'GROUP_NAME' => $groupdata[$i]['group_name'], ! 'VIEW_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $view_groups ) ) ? 'checked="checked"' : '', ! 'UPLOAD_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $upload_groups ) ) ? 'checked="checked"' : '', ! 'RATE_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $rate_groups ) ) ? 'checked="checked"' : '', ! 'COMMENT_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $comment_groups ) ) ? 'checked="checked"' : '', ! 'EDIT_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $edit_groups ) ) ? 'checked="checked"' : '', ! 'DELETE_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $delete_groups ) ) ? 'checked="checked"' : '', ! 'MODERATOR_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $moderator_groups ) ) ? 'checked="checked"' : '' ) ); } ! $template->pparse( 'body' ); ! include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); } else { ! $cat_id = intval( $HTTP_GET_VARS['cat_id'] ); ! $view_groups = @implode( ',', $HTTP_POST_VARS['view'] ); ! $upload_groups = @implode( ',', $HTTP_POST_VARS['upload'] ); ! $rate_groups = @implode( ',', $HTTP_POST_VARS['rate'] ); ! $comment_groups = @implode( ',', $HTTP_POST_VARS['comment'] ); ! $edit_groups = @implode( ',', $HTTP_POST_VARS['edit'] ); ! $delete_groups = @implode( ',', $HTTP_POST_VARS['delete'] ); ! $moderator_groups = @implode( ',', $HTTP_POST_VARS['moderator'] ); ! $sql = "UPDATE " . ALBUM_CAT_TABLE . " SET cat_view_groups = '$view_groups', cat_upload_groups = '$upload_groups', cat_rate_groups = '$rate_groups', cat_comment_groups = '$comment_groups', cat_edit_groups = '$edit_groups', cat_delete_groups = '$delete_groups', cat_moderator_groups = '$moderator_groups' WHERE cat_id = '$cat_id'"; ! if ( !$result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not update Album config table', '', __LINE__, __FILE__, $sql ); } + // okay, return a message... + $message = $lang['Album_Auth_successfully'] . '<br /><br />' . sprintf( $lang['Click_return_album_auth'], '<a href="' . append_sid( "admin_album_auth.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); ! mx_message_die( GENERAL_MESSAGE, $message ); } } ?> \ No newline at end of file |