[Phpbbproject-svn] SF.net SVN: phpbbproject: [276] trunk
phpBB download manager, mainly aimed at MOD authors
Status: Planning
Brought to you by:
lord_le_brand
From: <lor...@us...> - 2008-05-04 00:34:39
|
Revision: 276 http://phpbbproject.svn.sourceforge.net/phpbbproject/?rev=276&view=rev Author: lord_le_brand Date: 2008-05-03 17:34:46 -0700 (Sat, 03 May 2008) Log Message: ----------- Removed/Commented out all auth stuff for now: wait for poyntesm's patch Updated constants.php and create_schema_files_phpbb3.php Added project_build_select() for buidling dropdown boxes Tracker should be done soonish :) Modified Paths: -------------- trunk/develop/create_schema_files_phpbb3.php trunk/develop/permissions.txt trunk/develop/todo_list.txt trunk/phpbb3/root/includes/project/project_main.php trunk/phpbb3/root/includes/project/project_trackers.php trunk/phpbb3/root/includes/sources_project/constants.php trunk/phpbb3/root/includes/sources_project/create_project.php trunk/phpbb3/root/includes/sources_project/extensions.php trunk/phpbb3/root/includes/sources_project/functions_project.php trunk/phpbb3/root/project.php Modified: trunk/develop/create_schema_files_phpbb3.php =================================================================== --- trunk/develop/create_schema_files_phpbb3.php 2008-04-30 00:35:28 UTC (rev 275) +++ trunk/develop/create_schema_files_phpbb3.php 2008-05-04 00:34:46 UTC (rev 276) @@ -821,15 +821,6 @@ ) ); - $schema_data['phpbb_project_project_authors'] = array( - 'COLUMNS' => array( - 'project_id' => array('UINT', '0'), - 'author_id' => array('UINT', '0'), - 'author_role' => array('UINT', '0'), - ), - 'PRIMARY_KEY' => array('project_id, author_id'), - ); - //------------------------------------------ // @@ -941,6 +932,14 @@ //------------------------------------------ // + // Permissions + // + + // @todo New table to work with poyntesm's auth patch + + //------------------------------------------ + + // // Trackers // Modified: trunk/develop/permissions.txt =================================================================== --- trunk/develop/permissions.txt 2008-04-30 00:35:28 UTC (rev 275) +++ trunk/develop/permissions.txt 2008-05-04 00:34:46 UTC (rev 276) @@ -1,17 +1,7 @@ Permissions for phpBB Project: -We're gonna have to make one or more new tables for permission masks. -This is because, apparently, the forum_id really isn't supposed to be used for something else. >_> +Wait for poyntesm to finish his patch for the auth class -New auth methods: - -- acl_getp($opt, $clean = false) - Like acl_getf($opt, $clean = false) but for projects -- acl_getc($opt, $clean = false) - Like acl_getf($opt, $clean = false) but for categories - -Extend or modify most others (when I understand them all some more...) - Assigned by authors: [?] - View the project (per project) Modified: trunk/develop/todo_list.txt =================================================================== --- trunk/develop/todo_list.txt 2008-04-30 00:35:28 UTC (rev 275) +++ trunk/develop/todo_list.txt 2008-05-04 00:34:46 UTC (rev 276) @@ -2,8 +2,6 @@ - Make a TODO tracker!!! - When at it make a bug tracker and feature tracker :) -- Extend auth class and create new permission tables -- Change the way authors are tied to projects (acl_roles or new equivalent) - Add /languages and /templates support to download (and import) class - Author ordering in MOD(X) file/project overview page - Definitive decision on storing versioned files @@ -11,6 +9,8 @@ - Expand validate_project_title() - Decide on what information will go on view category module - Target version information +- Wait till poyntesm finishes his auth patch + - Change the way authors are tied to projects using acl tables? - Decide on better module structure - Modules: - Import project Modified: trunk/phpbb3/root/includes/project/project_main.php =================================================================== --- trunk/phpbb3/root/includes/project/project_main.php 2008-04-30 00:35:28 UTC (rev 275) +++ trunk/phpbb3/root/includes/project/project_main.php 2008-05-04 00:34:46 UTC (rev 276) @@ -72,8 +72,13 @@ // If top ten should be displayed, do so if ($config['project_display_top_ten']) { + /** + * @todo when auth extended, rewrite $acl_projects = array_keys($auth->acl_getf('p_view_project', true)); $project_ids = $db->sql_in_set('project_id', $acl_projects, false, true); + */ + $project_ids = '1 = 1'; + $optional_fields = ($config['project_autopost_enable']) ? ', topic_id' : ''; $sql = "SELECT project_id, project_title, project_description, project_downloads $optional_fields @@ -134,9 +139,11 @@ // There are categories here, so display them $acl_categories = array(); $category_ids = '1 = 1'; - // Rewrite next line when auth class is extended - // $acl_categories = array_keys($auth->acl_getf('p_view_category', true)); - //$category_ids = $db->sql_in_set('category_id', $acl_categories, false, true); + /** + * @todo when auth extended, rewrite + $acl_categories = array_keys($auth->acl_getf('p_view_category', true)); + $category_ids = $db->sql_in_set('category_id', $acl_categories, false, true); + */ $sql = 'SELECT * FROM ' . PROJECT_CATEGORIES_TABLE . " @@ -243,8 +250,12 @@ $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC'); + /** + * @todo when auth extended, rewrite $acl_projects = array_keys($auth->acl_getf('p_view_project', true)); $project_ids = $db->sql_in_set('project_id', $acl_projects, false, true); + */ + $project_ids = '1 = 1'; $sql = "SELECT project_id, topic_id, project_title, project_description, project_level, project_install_time, project_target_version, project_version, project_stage, project_start_time, project_owner, project_last_update, project_downloads FROM " . PROJECT_PROJECTS_TABLE . " @@ -438,8 +449,12 @@ )); } + /** + * @todo when auth extended, rewrite $acl_categories = array_keys($auth->acl_getf('p_view_category', true)); $category_ids = $db->sql_in_set('category_id', $acl_categories, false, true); + */ + $category_ids = '1 = 1'; $sql = 'SELECT * FROM ' . PROJECT_CATEGORIES_TABLE . " Modified: trunk/phpbb3/root/includes/project/project_trackers.php =================================================================== --- trunk/phpbb3/root/includes/project/project_trackers.php 2008-04-30 00:35:28 UTC (rev 275) +++ trunk/phpbb3/root/includes/project/project_trackers.php 2008-05-04 00:34:46 UTC (rev 276) @@ -230,8 +230,39 @@ case 'add_ticket': + if (isset($_POST['submit'])) + { + // Check data and insert + } + // General tracker data + $sql = 'SELECT ty.tracker_type_title + FROM ' . PROJECT_TRACKER_TYPES_TABLE . ' ty, ' . PROJECT_TRACKERS_TABLE . " tr + WHERE ty.tracker_type_id = tr.tracker_type + AND tr.tracker_id = $tracker_id"; + $result = $db->sql_query($sql, 604800); + $tracker_title = $db->sql_fetchfield('tracker_type_title', false, $result); + $db->sql_freeresult($result); + // Get category dropdown + $sql = 'SELECT * + FROM ' . PROJECT_TRACKER_CATEGORIES_TABLE . " + WHERE tracker_id = $tracker_id" . ((!$is_author) ? ' AND is_private = 0' : ''); + $result = $db->sql_query($sql, 604800); + + while ($row = $db->sql_fetchrow($result)) + { + $category_select[$row['category_id']] = $row['category_title']; + } + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'PROJECT_TITLE' => $project_title, + 'TRACKER_TITLE' => $tracker_title, + + 'S_CATEGORIES_SELECT' => project_build_select($category_select, $category_id), + )); + break; /** Modified: trunk/phpbb3/root/includes/sources_project/constants.php =================================================================== --- trunk/phpbb3/root/includes/sources_project/constants.php 2008-04-30 00:35:28 UTC (rev 275) +++ trunk/phpbb3/root/includes/sources_project/constants.php 2008-05-04 00:34:46 UTC (rev 276) @@ -81,14 +81,14 @@ define('PROJECT_DOCUMENTATION_TABLE', $table_prefix . 'project_documentation'); define('PROJECT_LICENSES_TABLE', $table_prefix . 'project_licenses'); define('PROJECT_MARX_TABLE', $table_prefix . 'project_marx'); -define('PROJECT_PROJECT_AUTHORS_TABLE', $table_prefix . 'project_project_authors'); define('PROJECT_PROJECTS_TABLE', $table_prefix . 'project_projects'); define('PROJECT_SEARCH_WORDMATCH_TABLE', $table_prefix . 'project_search_wordmatch'); define('PROJECT_TRACKERS_TABLE', $table_prefix . 'project_trackers'); define('PROJECT_TRACKER_CATEGORIES_TABLE', $table_prefix . 'project_tracker_categories'); -define('PROJECT_TRACKER_ENTRIES_TABLE', $table_prefix . 'project_tracker_entries'); +define('PROJECT_TRACKER_COMMENTS_TABLE', $table_prefix . 'project_tracker_comments'); define('PROJECT_TRACKER_STATUS_TABLE', $table_prefix . 'project_tracker_status'); define('PROJECT_TRACKER_TYPES_TABLE', $table_prefix . 'project_tracker_types'); +define('PROJECT_TRACKER_TICKETS_TABLE', $table_prefix . 'project_tracker_tickets'); define('PROJECT_VERSIONS_TABLE', $table_prefix . 'project_versions'); ?> \ No newline at end of file Modified: trunk/phpbb3/root/includes/sources_project/create_project.php =================================================================== --- trunk/phpbb3/root/includes/sources_project/create_project.php 2008-04-30 00:35:28 UTC (rev 275) +++ trunk/phpbb3/root/includes/sources_project/create_project.php 2008-05-04 00:34:46 UTC (rev 276) @@ -39,7 +39,8 @@ { global $auth, $user; - // Check permissions + /** + * @todo Rewrite this when auth class is extended if (!$auth->acl_get('p_add_project')) { $this->error = $user->lang['PROJECT_NOT_AUTH_CREATE']; @@ -50,6 +51,7 @@ $this->error = $user->lang['PROJECT_NOT_AUTH_CAT']; return; } + */ // Time & date of project creation $this->current_time = time(); Modified: trunk/phpbb3/root/includes/sources_project/extensions.php =================================================================== --- trunk/phpbb3/root/includes/sources_project/extensions.php 2008-04-30 00:35:28 UTC (rev 275) +++ trunk/phpbb3/root/includes/sources_project/extensions.php 2008-05-04 00:34:46 UTC (rev 276) @@ -17,14 +17,8 @@ } /** - * phpBB Project Auth extension - * - * @package phpbbproject + * @todo poyntesm's patch is gonna be here, once it's released */ -class project_auth extends auth -{ - // Do stuff with extra tables... -} /** * phpBB Project Module extension @@ -91,6 +85,7 @@ $project_id = ($project_id === false) ? $this->acl_project_id : $project_id; $is_auth = false; + // @todo Rewrite this for auth extension eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z_]+)(,\$(?:c_|pr_|)id)?#', '#\$id#', '#\$c_id#', '#\$pr_id#', '#aclf_([a-z_]+)#', '#cfg_([a-z_]+)#', '#request_([a-z_]+)#'), array('(int) $auth->acl_get(\'\\1\'\\2)', '(int) $forum_id', '(int) $category_id', '(int) $project_id', '(int) $auth->acl_getf_global(\'\\1\')', '(int) $config[\'\\1\']', '!empty($_REQUEST[\'\\1\'])'), $module_auth) . ');'); return $is_auth; Modified: trunk/phpbb3/root/includes/sources_project/functions_project.php =================================================================== --- trunk/phpbb3/root/includes/sources_project/functions_project.php 2008-04-30 00:35:28 UTC (rev 275) +++ trunk/phpbb3/root/includes/sources_project/functions_project.php 2008-05-04 00:34:46 UTC (rev 276) @@ -37,6 +37,39 @@ } /** + * Build proper select box + * + * @param array $select_ary associative array containing the value/title pairs + * @param boolean|string $default Default selected value, false for none + * @param boolean|string $lang_key Key for nested language entries + * @return unknown + */ +function project_build_select($select_ary, $default = false, $lang_key = false) +{ + global $user; + + if ($lang_key) + { + $lang =& $user->lang[$lang_key]; + } + else + { + $lang =& $user->lang; + } + + $html = ''; + + foreach ($select_ary as $value => $title) + { + $title = (isset($lang[$title])) ? $lang[$title] : $title; + $selected = ($default !== false && $default == $value) ? ' selected="selected"' : ''; + $html .= "<option value=\"$value\"$selected>$title</option>\n"; + } + + return $html; +} + +/** * Merge file and diff * * @param string $original Modified: trunk/phpbb3/root/project.php =================================================================== --- trunk/phpbb3/root/project.php 2008-04-30 00:35:28 UTC (rev 275) +++ trunk/phpbb3/root/project.php 2008-05-04 00:34:46 UTC (rev 276) @@ -23,9 +23,9 @@ define('PROJECT_BASE_URL', "{$phpbb_root_path}project.$phpEx"); -// phpBB Project Auth extension -//unset($auth); -//$auth = new project_auth(); +/** + * @todo Initiate poyntesm's auth patch + */ // Basic parameter data $id = request_var('i', ''); @@ -45,6 +45,8 @@ $category_id = request_var('c', 0); $action = request_var('action', ''); +/** + * @todo Rewrite this for auth extension // If the user doesn't have any project permissions (globally or locally) he can't access any modules... if (!$auth->acl_getf_global('p_')) { @@ -62,6 +64,7 @@ { trigger_error($user->lang['PROJECT_NOT_AUTH_CAT']); } + */ if ($project_id) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |