From: <vb...@us...> - 2002-09-18 12:33:34
|
Update of /cvsroot/webnotes/webnotes In directory usw-pr-cvs1:/tmp/cvs-serv19524 Modified Files: .cvsignore action.php admin_change_password.php admin_index_files.php admin_manage_notes.php admin_manage_users.php admin_pending.php note_add.php note_add_page.php note_preview_page.php Added Files: user_home_page.php Log Message: - Added the home page (first page after login). - Refined the actions and added checks for the pages. - Implemented the access_denied() function. - Supporting enumerations (enum_api.php). - Added enumeration for access levels. --- NEW FILE: user_home_page.php --- <?php # phpWebNotes - a php based note addition system # Copyright (C) 2000-2002 Webnotes Team - web...@so... # This program is distributed under the terms and conditions of the GPL # See the files README and LICENSE for details # -------------------------------------------------------- # $Id: user_home_page.php,v 1.1 2002/09/18 12:33:31 vboctor Exp $ # -------------------------------------------------------- require_once( 'core' . DIRECTORY_SEPARATOR . 'api.php' ); login_cookie_check(); access_ensure_check_action( ACTION_USERS_EDIT_OWN ); $row = user_get_info( user_where_current() ); extract( $row, EXTR_PREFIX_ALL, "v" ); print_html_top(); print_head_top(); print_title( $g_window_title ); print_css( $g_css_inc_file ); print_head_bottom(); print_body_top(); print_header( $g_page_title ); print_top_page( $g_top_page_inc ); print_admin_menu(); $t_access_level = enum_get_element( 'access_levels', $v_access_level ); echo "<p>Logged in as $v_username ($t_access_level)</p>"; print_bottom_page( $g_bottom_page_inc ); print_footer( __FILE__ ); print_body_bottom(); print_html_bottom(); ?> Index: .cvsignore =================================================================== RCS file: /cvsroot/webnotes/webnotes/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .cvsignore 6 Sep 2002 17:03:35 -0000 1.3 +++ .cvsignore 18 Sep 2002 12:33:31 -0000 1.4 @@ -1 +1,2 @@ -*.PHPEdit* \ No newline at end of file +*.PHPEdit* +comments.txt \ No newline at end of file Index: action.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/action.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- action.php 11 Sep 2002 09:49:54 -0000 1.3 +++ action.php 18 Sep 2002 12:33:31 -0000 1.4 @@ -13,12 +13,12 @@ login_cookie_check(); if ( !isset( $f_action ) ) { - echo 'f_action not defined<br />'; + echo 'f_action not defined<br />'; exit; } if ( !isset( $f_url ) ) { - echo 'f_url not defined<br />'; + echo 'f_url not defined<br />'; exit; } else { $c_url = urldecode( $f_url ); @@ -40,11 +40,11 @@ if ( isset( $f_page_id ) ) { $c_page_id = stripslashes( urldecode( $f_page_id ) ); - if ( 'unindex' === $f_action ) { - page_delete( $c_page_id ); - } + if ( 'unindex' === $f_action ) { + page_delete( $c_page_id ); + } if ( 'index' === $f_action ) { - page_add( $c_page_id ); + page_add( $c_page_id ); } } @@ -60,7 +60,7 @@ print_admin_menu(); - echo "<br /><div align=\"center\">Operation Successful<br /><a href=\"$c_url\">[ Click here to proceed ]</a></div><br />"; + echo "<br /><div align=\"center\">Operation Successful<br /><a href=\"$c_url\">[ Click here to proceed ]</a></div><br />"; print_footer( __FILE__ ); print_bottom_page( $g_bottom_page_inc ); Index: admin_change_password.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_change_password.php,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- admin_change_password.php 17 Sep 2002 06:25:03 -0000 1.15 +++ admin_change_password.php 18 Sep 2002 12:33:31 -0000 1.16 @@ -10,6 +10,10 @@ require_once( 'core' . DIRECTORY_SEPARATOR . 'api.php' ); + login_cookie_check(); + + access_ensure_check_action( ACTION_USERS_EDIT_OWN ); + if ( isset( $f_action ) && ( $f_action == 'change' ) ) { $f_current_password = gpc_get_string( 'f_current_password' ); $f_password = gpc_get_string( 'f_password' ); Index: admin_index_files.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_index_files.php,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- admin_index_files.php 14 Sep 2002 15:19:12 -0000 1.16 +++ admin_index_files.php 18 Sep 2002 12:33:31 -0000 1.17 @@ -8,8 +8,10 @@ # $Id$ # -------------------------------------------------------- - require_once ( "core" . DIRECTORY_SEPARATOR . "api.php" ); + require_once ( 'core' . DIRECTORY_SEPARATOR . 'api.php' ); login_cookie_check(); + + access_ensure_check_action( ACTION_PAGES_MANAGE ); if ( !isset( $f_dir ) ) { $f_dir = dirname( __FILE__ ); Index: admin_manage_notes.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_manage_notes.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- admin_manage_notes.php 14 Sep 2002 15:19:12 -0000 1.13 +++ admin_manage_notes.php 18 Sep 2002 12:33:31 -0000 1.14 @@ -10,6 +10,10 @@ require_once( 'core' . DIRECTORY_SEPARATOR . 'api.php' ); + login_cookie_check(); + + access_ensure_check_action( ACTION_NOTES_MODERATE ); + if ( ( isset( $f_action ) ) && ( $f_action== 'delete' ) ) { note_delete( $f_id ); } Index: admin_manage_users.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_manage_users.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- admin_manage_users.php 14 Sep 2002 15:19:12 -0000 1.1 +++ admin_manage_users.php 18 Sep 2002 12:33:31 -0000 1.2 @@ -12,6 +12,8 @@ login_cookie_check(); + access_ensure_check_action( ACTION_USERS_MANAGE ); + print_html_top(); print_head_top(); print_title( $g_window_title ); Index: admin_pending.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_pending.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- admin_pending.php 14 Sep 2002 15:19:12 -0000 1.3 +++ admin_pending.php 18 Sep 2002 12:33:31 -0000 1.4 @@ -12,6 +12,8 @@ login_cookie_check(); + access_ensure_check_action( ACTION_NOTES_MODERATE ); + print_html_top(); print_head_top(); print_title( $g_window_title ); Index: note_add.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/note_add.php,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- note_add.php 18 Sep 2002 06:55:02 -0000 1.15 +++ note_add.php 18 Sep 2002 12:33:31 -0000 1.16 @@ -10,7 +10,7 @@ require_once( 'core' . DIRECTORY_SEPARATOR . 'api.php' ); - #access_ensure_check_action( ACTION_NOTES_SUBMIT ); + access_ensure_check_action( ACTION_NOTES_SUBMIT ); $f_page_id = gpc_get_int( 'f_page_id' ); $f_email = stripslashes( gpc_get_string( 'f_email' ) ); Index: note_add_page.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/note_add_page.php,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- note_add_page.php 18 Sep 2002 06:55:02 -0000 1.17 +++ note_add_page.php 18 Sep 2002 12:33:31 -0000 1.18 @@ -10,7 +10,7 @@ require_once( 'core' . DIRECTORY_SEPARATOR . 'api.php' ); - #access_ensure_check_action( ACTION_NOTES_SUBMIT ); + access_ensure_check_action( ACTION_NOTES_SUBMIT ); print_html_top(); print_head_top(); Index: note_preview_page.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/note_preview_page.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- note_preview_page.php 15 Sep 2002 05:08:04 -0000 1.5 +++ note_preview_page.php 18 Sep 2002 12:33:31 -0000 1.6 @@ -10,6 +10,8 @@ require_once( 'core' . DIRECTORY_SEPARATOR . 'api.php' ); + access_ensure_check_action( ACTION_NOTES_SUBMIT ); + print_html_top(); print_head_top(); print_title( $g_window_title ); |