You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(240) |
Oct
(66) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(9) |
Sep
(7) |
Oct
|
Nov
|
Dec
|
From: <vb...@us...> - 2002-09-19 22:50:42
|
Update of /cvsroot/webnotes/webnotes/sql In directory usw-pr-cvs1:/tmp/cvs-serv26969/sql Modified Files: db_upgrade.sql Log Message: - Added prev_id and next_id to the pages table. - Handled prev/next from theme - Auto setting prev/next if specific in the call to webnotes. - Added XHTML example, to demonstrate the prev / prev-next / next. There is still a problem with pages that have no notes. Index: db_upgrade.sql =================================================================== RCS file: /cvsroot/webnotes/webnotes/sql/db_upgrade.sql,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- db_upgrade.sql 19 Sep 2002 21:51:02 -0000 1.4 +++ db_upgrade.sql 19 Sep 2002 22:50:39 -0000 1.5 @@ -1,3 +1,5 @@ ALTER TABLE `phpWN_user_table` CHANGE `password` `password` VARCHAR( 32 ) NOT NULL; ALTER TABLE `phpWN_user_table` CHANGE `access_level` `access_level` INT( 2 ) DEFAULT '40' NOT NULL; ALTER TABLE `phpWN_page_table` ADD `url` VARCHAR( 255 ) NOT NULL ; +ALTER TABLE `phpWN_page_table` ADD `prev_id` INT( 10 ) UNSIGNEDZEROFILL NOT NULL ; +ALTER TABLE `phpWN_page_table` ADD `next_id` INT( 10 ) UNSIGNEDZEROFILL NOT NULL ; |
From: <vb...@us...> - 2002-09-19 22:50:41
|
Update of /cvsroot/webnotes/webnotes/sample In directory usw-pr-cvs1:/tmp/cvs-serv26969/sample Modified Files: webservices.php xml.php Added Files: xhtml.php Log Message: - Added prev_id and next_id to the pages table. - Handled prev/next from theme - Auto setting prev/next if specific in the call to webnotes. - Added XHTML example, to demonstrate the prev / prev-next / next. There is still a problem with pages that have no notes. --- NEW FILE: xhtml.php --- <html> <head> <title>XHTML</title> </head> <body> <h1>XHTML</h1> <p>Short for Extensible Hypertext Markup Language, a hybrid between HTML and XML specifically designed for Net device displays.</p> <p>XHTML is a markup language written in XML; therefore, it is an XML application.</p> <p>XHTML uses three XML namespaces (used to qualify element and attributes names by associating them with namespaces identified by URI references. Namespaces prevent identically custom-named tags that may be used in different XML documents from being read the same way), which correspond to three HTML 4.0 DTDs: Strict, Transitional, and Frameset.</p> <p>XHTML markup must conform to the markup standards defined in a HTML DTD.</p> <p>When applied to Net devices, XHTML must go through a modularization process. This enables XHTML pages to be read by many different platforms.</p> <p>A device designer, using standard building blocks, will specify which elements are supported. Content creators will then target these building blocks--or modules.</p> <p>Because these modules conform to certain standards, XHTML's extensibility ensures that layout and presentation stay true-to-form over any platform.</p> <?php require_once("../core/api.php"); # replace with actual path print_web_notes( 'XHTML', $PHP_SELF, 'XML', 'Web Services' ); ?> </body> </html> Index: webservices.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/sample/webservices.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- webservices.php 12 Sep 2002 13:31:46 -0000 1.5 +++ webservices.php 19 Sep 2002 22:50:38 -0000 1.6 @@ -28,7 +28,7 @@ <?php require_once("../core/api.php"); # replace with actual path - print_web_notes( 'Web Services', $PHP_SELF ); + print_web_notes( 'Web Services', $PHP_SELF, 'XHTML', null ); ?> <br /> Index: xml.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/sample/xml.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- xml.php 12 Sep 2002 13:31:46 -0000 1.5 +++ xml.php 19 Sep 2002 22:50:38 -0000 1.6 @@ -21,7 +21,7 @@ <?php require_once("../core/api.php"); # replace with actual path - print_web_notes( 'XML', $PHP_SELF ); + print_web_notes( 'XML', $PHP_SELF, null, 'XHTML' ); ?> <br /> <a href="http://sourceforge.net/projects/webnotes/"><img src="http://sourceforge.net/sflogo.php?group_id=15381&type=5" width="140" height="42" border="0" alt="phpWebNotes @ SourceForge"></a> |
From: <vb...@us...> - 2002-09-19 22:50:41
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv26969/core Modified Files: link_api.php note_api.php page_api.php Log Message: - Added prev_id and next_id to the pages table. - Handled prev/next from theme - Auto setting prev/next if specific in the call to webnotes. - Added XHTML example, to demonstrate the prev / prev-next / next. There is still a problem with pages that have no notes. Index: link_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/link_api.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- link_api.php 19 Sep 2002 04:15:48 -0000 1.4 +++ link_api.php 19 Sep 2002 22:50:38 -0000 1.5 @@ -13,6 +13,14 @@ ########################################################################### ### -------------------- + function link_create( $p_url, $p_caption, $p_link_active, $p_prefix = '[ ', $p_suffix = ' ]' ) { + if ( !empty( $p_url ) || (false === p_link_active) ) { + return "$p_prefix<a href=\"$p_url\">$p_caption</a>$p_suffix"; + } else { + return "$p_prefix$p_caption$p_suffix"; + } + } + ### -------------------- function link_note_action( $p_note_id, $p_action, $p_url, $p_link_active = true, $p_caption = null ) { if ( null === $p_caption ) { $t_caption = lang_get( 'action_' . $p_action ); @@ -27,13 +35,9 @@ $c_action = urlencode( $p_action ); $c_url = urlencode( $p_url ); $t_action = config_get( 'web_directory') . 'action.php'; + $t_link = "$t_action?f_action=$c_action&f_note_id=$c_note_id&f_url=$c_url"; - if ( $p_link_active ) { - $t_link = "$t_action?f_action=$c_action&f_note_id=$c_note_id&f_url=$c_url"; - return $t_before . "<a href=\"$t_link\">$t_caption</a>" . $t_after; - } else { - return $t_before . $t_caption . $t_after; - } + return( link_create( $t_link, $t_caption, $p_link_active, $t_before, $t_after ) ); } ### -------------------- # $p_page = $p_page_id if action is unindex @@ -52,12 +56,8 @@ $c_action = urlencode( $p_action ); $c_url = urlencode( $p_url ); $t_action = config_get( 'web_directory' ) . 'action.php'; + $t_link = "$t_action?f_action=$c_action&f_page_id=$c_page_id&f_url=$c_url"; - if ( $p_link_active ) { - $t_link = "$t_action?f_action=$c_action&f_page_id=$c_page_id&f_url=$c_url"; - return $t_before . "<a href=\"$t_link\">$t_caption</a>" . $t_after; - } else { - return $t_before . "$t_caption" . $t_after; - } + return( link_create( $t_link, $t_caption, $p_link_active, $t_before, $t_after ) ); } ?> Index: note_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/note_api.php,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- note_api.php 19 Sep 2002 21:51:01 -0000 1.19 +++ note_api.php 19 Sep 2002 22:50:38 -0000 1.20 @@ -112,8 +112,6 @@ return; } - page_update_url( $c_id, $p_url ); - $c_page_name = db_prepare_string( $p_page_name ); $query = "SELECT * @@ -253,26 +251,29 @@ } } ### -------------------- - function print_web_notes( $p_file, $p_url ) { + function print_web_notes( $p_page, $p_url, $p_prev_page = null, $p_next_page = null ) { echo '<br />'; - $t_page_id = page_get_id( $p_file ); + $t_page_id = page_get_id( $p_page ); if ( !page_valid_id( $t_page_id ) ) { if ( ON === config_get( 'auto_index_pages' ) ) { - if ( page_add( $p_file ) ) { - print_web_notes( $p_file, $p_url ); + if ( page_add( $p_page ) ) { + print_web_notes( $p_page, $p_url, $p_prev_page, $p_next_page ); return; } } - theme_not_indexed( $p_file, $p_url ); + theme_not_indexed( $p_page, $p_url ); } else { + page_update_url( $t_page_id, $p_url ); + page_update_neighbours( $t_page_id, $p_prev_page, $p_next_page ); + if ( page_visible_notes_count ( $t_page_id ) > 0 ) { - theme_notes_start( $p_file, $p_url ); - note_print_all( $p_file, $p_url ); - theme_notes_end( $p_file, $p_url ); + theme_notes_start( $p_page, $p_url ); + note_print_all( $p_page, $p_url ); + theme_notes_end( $p_page, $p_url ); } else { - theme_notes_none( $p_file, $p_url ); + theme_notes_none( $p_page, $p_url ); } } } Index: page_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/page_api.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- page_api.php 19 Sep 2002 21:51:02 -0000 1.11 +++ page_api.php 19 Sep 2002 22:50:38 -0000 1.12 @@ -135,6 +135,42 @@ $result = db_query( $query ); } ### -------------------- + function page_update_neighbours( $p_page_id, $p_prev, $p_next ) { + if ( ( null === $p_prev ) && ( null === $p_next ) ) { + return; + } + + $t_page_info = page_get_info( page_where_id_equals( $p_page_id ) ); + if ( false === $t_page_info ) { + return; + } + + if ( null === $p_prev ) { + $t_prev_id = 0; + } else { + $t_prev_id = page_get_id( $p_prev ); + #if ( false === page_valid_id( $t_prev_id ) ) { + # $t_prev_id = 0; + #} + } + + if ( null === $p_next ) { + $t_next_id = 0; + } else { + $t_next_id = page_get_id( $p_next ); + if ( false === page_valid_id( $t_next_id ) ) { + $t_next_id = 0; + } + } + + $c_page_id = db_prepare_int( $p_page_id ); + + $query = "UPDATE " . config_get( 'phpWN_page_table' ) . " + SET prev_id='$t_prev_id', next_id='$t_next_id' + WHERE id='$c_page_id' LIMIT 1"; + $result = db_query( $query ); + } + ### -------------------- ### Allows for path navigation to choose base dir function print_dirs( $p_path, $p_php_self ) { global $g_admin_index_files; |
From: <vb...@us...> - 2002-09-19 21:51:06
|
Update of /cvsroot/webnotes/webnotes/themes/phpnet/images In directory usw-pr-cvs1:/tmp/cvs-serv10100/themes/phpnet/images Added Files: caret_left.gif caret_right.gif spacer.gif Log Message: - Added url field into page table. - Added code to auto-set the url when the page is viewed. - Some updates to the installation document (still needs a lot of work). - Added some images to the phpnet theme (previous, next, spacer) - Started working on the support for previous / next page. - Started the implementation of the Manage Notes page. - Removed the admin menu link to the admin_pending.php (will be removed soon). - Removed theme_note_add_page.php (never used) - Removed theme_note_preview_page.php (never used) --- NEW FILE: caret_left.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: caret_right.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: spacer.gif --- (This appears to be a binary file; contents omitted.) |
From: <vb...@us...> - 2002-09-19 21:51:05
|
Update of /cvsroot/webnotes/webnotes/themes/phpnet In directory usw-pr-cvs1:/tmp/cvs-serv10100/themes/phpnet Modified Files: theme_api.php Removed Files: theme_note_add_page.php theme_note_preview_page.php Log Message: - Added url field into page table. - Added code to auto-set the url when the page is viewed. - Some updates to the installation document (still needs a lot of work). - Added some images to the phpnet theme (previous, next, spacer) - Started working on the support for previous / next page. - Started the implementation of the Manage Notes page. - Removed the admin menu link to the admin_pending.php (will be removed soon). - Removed theme_note_add_page.php (never used) - Removed theme_note_preview_page.php (never used) Index: theme_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/themes/phpnet/theme_api.php,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- theme_api.php 19 Sep 2002 05:15:47 -0000 1.14 +++ theme_api.php 19 Sep 2002 21:51:02 -0000 1.15 @@ -36,12 +36,9 @@ $c_url = urlencode( $p_url ); $t_page_id = page_get_id( $p_page ); - #$path = dirname ( __FILE__ ) . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR; - #$image = $path .'notes_add.gif'; - - $url = $g_web_directory . 'themes/' . $g_theme . '/images/'; - $add_picture = $url . 'notes_add.gif'; - $help_picture = $url . 'notes_about.gif'; + $t_images_base = $g_web_directory . 'themes/' . $g_theme . '/images/'; + $add_picture = $t_images_base . 'notes_add.gif'; + $help_picture = $t_images_base . 'notes_about.gif'; if ( !$p_preview ) { $t_link_start = "<a href=\"$g_note_add_page?f_page_id=$t_page_id&f_url=$c_url\">"; @@ -147,10 +144,12 @@ $c_url = urlencode( $p_url ); $t_page_id = page_get_id( $p_page ); - $url = $g_web_directory . 'themes/' . $g_theme . '/images/'; - $add_picture = $url . 'notes_add.gif'; - $help_picture = $url . 'notes_about.gif'; - + $t_images_base = $g_web_directory . 'themes/' . $g_theme . '/images/'; + $add_picture = $t_images_base . 'notes_add.gif'; + $help_picture = $t_images_base . 'notes_about.gif'; + $prev_picture = $t_images_base . 'caret_left.gif'; + $next_picture = $t_images_base . 'caret_right.gif'; + if ( !$p_preview ) { $t_link_start = "<a href=\"$g_note_add_page?f_page_id=$t_page_id&f_url=$c_url\">"; $t_link_end = '</a>'; @@ -166,7 +165,16 @@ </td> </tr> </table> + <table border="0" width="100%" bgcolor="#e0e0e0" cellpadding="0" cellspacing="4"> + <tr><td><img src="$prev_picture" border="0" width="11" height="7" alt="Previous" />Previous</td> + <td align="right">Next<img src="$next_picture" border="0" width="11" height="7" alt="Next" /></td></tr> + <tr bgcolor="#cccccc"><td colspan="2"></td></tr> + <tr><td align="right" colspan="2"><small>Last updated: Tue, 17 Sep 2002</small></td></tr> + </table> EOT; +# </td></tr></table></td></tr></table> +# <img src="/gifs/caret-r.gif" border="0" width="11" height="7" ALT="next" /> +# <img src="/gifs/spacer.gif" width="1" height="1" border="0" alt="" /> } # This function is called if the current page has no notes associated --- theme_note_add_page.php DELETED --- --- theme_note_preview_page.php DELETED --- |
From: <vb...@us...> - 2002-09-19 21:51:05
|
Update of /cvsroot/webnotes/webnotes/sql In directory usw-pr-cvs1:/tmp/cvs-serv10100/sql Modified Files: db_upgrade.sql Log Message: - Added url field into page table. - Added code to auto-set the url when the page is viewed. - Some updates to the installation document (still needs a lot of work). - Added some images to the phpnet theme (previous, next, spacer) - Started working on the support for previous / next page. - Started the implementation of the Manage Notes page. - Removed the admin menu link to the admin_pending.php (will be removed soon). - Removed theme_note_add_page.php (never used) - Removed theme_note_preview_page.php (never used) Index: db_upgrade.sql =================================================================== RCS file: /cvsroot/webnotes/webnotes/sql/db_upgrade.sql,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- db_upgrade.sql 16 Sep 2002 04:47:22 -0000 1.3 +++ db_upgrade.sql 19 Sep 2002 21:51:02 -0000 1.4 @@ -1,2 +1,3 @@ ALTER TABLE `phpWN_user_table` CHANGE `password` `password` VARCHAR( 32 ) NOT NULL; ALTER TABLE `phpWN_user_table` CHANGE `access_level` `access_level` INT( 2 ) DEFAULT '40' NOT NULL; +ALTER TABLE `phpWN_page_table` ADD `url` VARCHAR( 255 ) NOT NULL ; |
From: <vb...@us...> - 2002-09-19 21:51:05
|
Update of /cvsroot/webnotes/webnotes/doc In directory usw-pr-cvs1:/tmp/cvs-serv10100/doc Modified Files: INSTALL Log Message: - Added url field into page table. - Added code to auto-set the url when the page is viewed. - Some updates to the installation document (still needs a lot of work). - Added some images to the phpnet theme (previous, next, spacer) - Started working on the support for previous / next page. - Started the implementation of the Manage Notes page. - Removed the admin menu link to the admin_pending.php (will be removed soon). - Removed theme_note_add_page.php (never used) - Removed theme_note_preview_page.php (never used) Index: INSTALL =================================================================== RCS file: /cvsroot/webnotes/webnotes/doc/INSTALL,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- INSTALL 9 Sep 2002 11:24:30 -0000 1.4 +++ INSTALL 19 Sep 2002 21:51:02 -0000 1.5 @@ -20,13 +20,18 @@ mysql -u<username> -p<password> <databasename> < db_generate.sql +Then you will need to upgrade the db to the latest (that's only needed if you have +downloaded a CVS version). + +mysql -u<username> -p<password> <databasename> < db_upgrade.sql + You could also cut and paste the sql statements from db_generate.sql into a package like phpMyAdmin. You will need to have created the database ahead of time. 4. Create core/custom_config_inc.php which overrides the default values in -config_inc.php. You can edit directly the config_inc.php but this will make it -harder to upgrade to future releases of phpWebNotes. In particular you +config_defaults_inc.php. You can edit directly the config_defaults_inc.php but +this will make it harder to upgrade to future releases of phpWebNotes. In particular you will want to set the database variables: hostname, username, password, and database name. These must be set to match the configuration of your webserver and mysql database. Also, don't forget to input the correct directory paths. @@ -46,25 +51,34 @@ <? require_once("/mypath/api.php"); # replace with actual path - print_web_notes( __FILE__, $PHP_SELF ); + print_web_notes( 'my-page-logical-name', $PHP_SELF ); ?> -The include argument should be the absolute path to your installation of +You can replace the 'my-page-logical-name' with __FILE__ if you don't want to +assign ids to the pages. + +The require_once argument should be the absolute path to your installation of phpWebNotes. It should not be relative to what your browser would see. This way if you have lots of files in different directories you will always be able to add the web note functionality to each page. -7. You will need to index the files in your website. Open up the phpWebNotes +7. If you want the pages to auto-index (register themselves) in the database +(default) then skip the next step. + +8. You will need to index the files in your website. Open up the phpWebNotes directory in your web browser and login. The default username and password is administrator / root. You should change this later on! Open up the "File Index" page. Select the root directory and then choose the Index button. It indexes all files in the directory it is located in and all subdirectories. -8. Notes will be added to a queue. They need to be approved by the +9. If you need the notes to be moderated before they appear on the webpage then +leave $g_auto_accept_notes = OFF, otherwise set it to ON and go to step 11. + +10. Notes will be added to a queue. They need to be approved by the administrator before they will become visible. You can do this from the admin section by choosing "View Queue". -9. You can edit or delete notes later on by going to the page and selecting +11. You can edit or delete notes later on by going to the page and selecting Manage. This option will only be available if you have logged in as an administrator. |
From: <vb...@us...> - 2002-09-19 21:51:04
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv10100/core Modified Files: html_api.php note_api.php page_api.php Log Message: - Added url field into page table. - Added code to auto-set the url when the page is viewed. - Some updates to the installation document (still needs a lot of work). - Added some images to the phpnet theme (previous, next, spacer) - Started working on the support for previous / next page. - Started the implementation of the Manage Notes page. - Removed the admin menu link to the admin_pending.php (will be removed soon). - Removed theme_note_add_page.php (never used) - Removed theme_note_preview_page.php (never used) Index: html_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/html_api.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- html_api.php 18 Sep 2002 13:17:40 -0000 1.7 +++ html_api.php 19 Sep 2002 21:51:01 -0000 1.8 @@ -113,9 +113,9 @@ } ### -------------------- function print_admin_menu() { - global $g_logout, $g_admin_index_files, $g_admin_pending, $g_admin_change_password, + global $g_logout, $g_admin_index_files, $g_admin_change_password, $g_admin_manage_notes, $g_admin_manage_users, - $s_logout_link, $s_index_files, $s_view_queue, $s_change_password, + $s_logout_link, $s_index_files, $s_change_password, $s_manage_notes, $s_manage_users, $g_user_home_page; $queue_count = note_queue_count(); @@ -126,13 +126,10 @@ echo "<a href=\"$g_admin_index_files\">$s_index_files</a> :: "; } if ( access_check_action( ACTION_NOTES_MODERATE ) ) { - echo "<a href=\"$g_admin_manage_notes\">$s_manage_notes</a> :: "; + echo "<a href=\"$g_admin_manage_notes\">$s_manage_notes</a> [$queue_count] :: "; } if ( access_check_action( ACTION_USERS_MANAGE ) ) { echo "<a href=\"$g_admin_manage_users\">$s_manage_users</a> :: "; - } - if ( access_check_action( ACTION_NOTES_MODERATE ) ) { - echo "<a href=\"$g_admin_pending\">$s_view_queue</a> [$queue_count] :: "; } if ( access_check_action( ACTION_USERS_EDIT_OWN ) ) { echo "<a href=\"$g_admin_change_password\">$s_change_password</a> :: "; Index: note_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/note_api.php,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- note_api.php 19 Sep 2002 05:15:47 -0000 1.18 +++ note_api.php 19 Sep 2002 21:51:01 -0000 1.19 @@ -107,6 +107,13 @@ } ### -------------------- function note_print_all( $p_page_name, $p_url ) { + $c_id = page_get_id( $p_page_name ); + if ( false === page_valid_id( $c_id ) ) { + return; + } + + page_update_url( $c_id, $p_url ); + $c_page_name = db_prepare_string( $p_page_name ); $query = "SELECT * Index: page_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/page_api.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- page_api.php 19 Sep 2002 04:15:48 -0000 1.10 +++ page_api.php 19 Sep 2002 21:51:02 -0000 1.11 @@ -9,28 +9,79 @@ # -------------------------------------------------------- ### -------------------- - function page_get_id( $p_file ) { - $c_file = db_prepare_string( $p_file ); - - $query = "SELECT id + function page_where_url_exists() { + return ("(url <> '')"); + } + ### -------------------- + function page_where_id_equals( $p_page_id ) { + $c_page_id = db_prepare_int( $p_page_id ); + return ("(id='$c_page_id')"); + } + ### -------------------- + function page_where_all() { + return ("(1=1)"); + } + ### -------------------- + function page_where_page_equals( $p_page ) { + $c_page_id = db_prepare_string( $p_page ); + return ("(page='$c_page_id')"); + } + ### -------------------- + # $p_where is constructed by page_where* and hence does not need to be cleaned. + function page_get_info ( $p_where, $p_field = null ) { + $query = "SELECT * FROM " . config_get( 'phpWN_page_table' ) . " - WHERE page='$c_file' + WHERE $p_where LIMIT 1"; $result = db_query( $query ); if ( db_num_rows( $result) > 0 ) { - return db_result( $result, 0, 0 ); + $t_info = db_fetch_array( $result ); + + if ( null === $p_field ) { + return $t_info; + } else { + #echo "$p_field\n"; var_dump($t_info); exit; + return $t_info["$p_field"]; + } } return false; } ### -------------------- + # $p_where is constructed by page_where* and hence does not need to be cleaned. + function page_get_array ( $p_where, $p_order = null ) { + if ( null !== $p_order ) { + $p_order = 'ORDER BY ' . $p_order; + $c_order = db_prepare_string( $p_order ); + } else { + $c_order = ''; + } + + $query = "SELECT * + FROM " . config_get( 'phpWN_page_table' ) . " + WHERE $p_where + $c_order"; + + $t_array = array(); + $result = db_query( $query ); + while ( $row = db_fetch_array( $result ) ) { + $t_array[] = $row; + } + + return $t_array; + } + ### -------------------- + function page_get_id( $p_page ) { + return ( page_get_info( page_where_page_equals( $p_page ), 'id' ) ); + } + ### -------------------- function page_valid_id( $p_page_id ) { return ( false !== $p_page_id ); } ### -------------------- - function page_is_indexed( $p_file ) { - return ( page_valid_id( page_get_id( $p_file ) ) ); + function page_is_indexed( $p_page ) { + return ( page_valid_id( page_get_id( $p_page ) ) ); } ### -------------------- function page_visible_notes_count( $p_page_id ) { @@ -67,6 +118,21 @@ } return false; + } + ### -------------------- + function page_update_url( $p_page_id, $p_url ) { + $t_url = page_get_info( page_where_id_equals( $p_page_id ), 'url' ); + if ( $t_url === $p_url ) { + return; + } + + $c_page_id = db_prepare_int( $p_page_id ); + $c_url = db_prepare_string( $p_url ); + + $query = "UPDATE " . config_get( 'phpWN_page_table' ) . " + SET url='$c_url' + WHERE id='$c_page_id' LIMIT 1"; + $result = db_query( $query ); } ### -------------------- ### Allows for path navigation to choose base dir |
From: <vb...@us...> - 2002-09-19 21:51:04
|
Update of /cvsroot/webnotes/webnotes In directory usw-pr-cvs1:/tmp/cvs-serv10100 Modified Files: admin_manage_notes.php Log Message: - Added url field into page table. - Added code to auto-set the url when the page is viewed. - Some updates to the installation document (still needs a lot of work). - Added some images to the phpnet theme (previous, next, spacer) - Started working on the support for previous / next page. - Started the implementation of the Manage Notes page. - Removed the admin menu link to the admin_pending.php (will be removed soon). - Removed theme_note_add_page.php (never used) - Removed theme_note_preview_page.php (never used) Index: admin_manage_notes.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_manage_notes.php,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- admin_manage_notes.php 18 Sep 2002 12:33:31 -0000 1.14 +++ admin_manage_notes.php 19 Sep 2002 21:51:01 -0000 1.15 @@ -14,14 +14,6 @@ access_ensure_check_action( ACTION_NOTES_MODERATE ); - if ( ( isset( $f_action ) ) && ( $f_action== 'delete' ) ) { - note_delete( $f_id ); - } - - if ( ( isset( $f_action ) ) && ( $f_action == 'update' ) ) { - note_update( $f_id, $f_email, $f_note ); - } - print_html_top(); print_head_top(); print_title( $g_window_title ); @@ -30,30 +22,16 @@ print_body_top(); print_header( $g_page_title ); print_top_page( $g_top_page_inc ); + print_admin_menu (); -?> -<div align="center"> -<a href="<?php echo $f_url ?>"><?php echo $s_back_link ?></a> -<br /> -<table bgcolor="<?php echo $g_table_border_color ?>" width="75%" cellspacing="1" border="0"> -<tr bgcolor="<?php echo $g_header_color ?>"> - <td colspan="2"> - <strong><?php echo $s_manage_notes_title ?></strong> - </td> -</tr> -<tr bgcolor="<?php echo $g_white_color ?>"> - <td width="10%"> - <?php echo $s_page ?> - </td> - <td width="90%"> - <?php echo $f_url ?> - </td> -</tr> -<?php print_manage_notes( $f_page_id, $f_url ) ?> -</table> -</div> -<?php + $pages = page_get_array ( page_where_url_exists() ); + + foreach( $pages as $page ) { + extract( $page, EXTR_PREFIX_ALL, 'v' ); + echo "<a href=\"$v_url\" target=\"_blank\">$v_page</a> - $v_url<br />\n"; + } + print_footer( __FILE__ ); print_bottom_page( $g_bottom_page_inc ); print_body_bottom(); |
From: <vb...@us...> - 2002-09-19 05:15:51
|
Update of /cvsroot/webnotes/webnotes/themes/phpnet In directory usw-pr-cvs1:/tmp/cvs-serv6789/themes/phpnet Modified Files: theme_api.php Log Message: - Fixed a typo in the name of note_update_visibility() - Added to the phpnet theme the [ actions ] to change the visibility of a note. - Display in phpnet theme the visibility of notes if the user can moderate. - Filtering all notes in the pages based on access rights, rather than only viewing accepted independent of access rights. Index: theme_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/themes/phpnet/theme_api.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- theme_api.php 19 Sep 2002 04:15:48 -0000 1.13 +++ theme_api.php 19 Sep 2002 05:15:47 -0000 1.14 @@ -67,16 +67,36 @@ # function. The theme should check that a field is defined in # the array before using it. function theme_notes_echo( $p_page, $p_url, $p_note_info_array, $p_preview = false ) { - if ( access_check_action( ACTION_NOTES_MODERATE ) ) { - # @@@@ replace this with [ actions ] - $t_moderation = "This user can moderator"; - } else { - $t_moderation = ''; + $t_moderation = ''; + + if ( false === $p_preview ) { + if ( access_check_action( ACTION_NOTES_MODERATE ) ) { + $t_url = $p_url; # . "#" . $p_note_info_array['id']; + $t_moderation = '<small>'; + + $t_moderation .= link_note_action( $p_note_info_array['id'], 'accept', $t_url, + access_check_action( ACTION_NOTES_MODERATE_ACCEPT ) ) . ' '; + + $t_moderation .= link_note_action( $p_note_info_array['id'], 'decline', $t_url, + access_check_action( ACTION_NOTES_MODERATE_DECLINE ) ) . ' '; + + $t_moderation .= link_note_action( $p_note_info_array['id'], 'archive', $t_url, + access_check_action( ACTION_NOTES_MODERATE_ARCHIVE ) ) . ' '; + + $t_moderation .= link_note_action( $p_note_info_array['id'], 'delete', $t_url, + access_check_action( ACTION_NOTES_MODERATE_DELETE ) ); + + $t_moderation .= '</small>'; + } } if ( isset( $p_note_info_array['id'] ) && ( $p_note_info_array['id'] != 0 ) ) { $t_id = '#' . (integer)$p_note_info_array['id']; - $t_id_view = '<pre>' . $t_id . '<br />' . $t_moderation . '</pre>'; + $t_visibility = ''; + if ( NOTE_VISIBLE_ACCEPTED != $p_note_info_array['visible'] ) { + $t_visibility = '(' . note_get_visibility_str( $p_note_info_array['visible'] ) . ') - '; + } + $t_id_view = "<pre>$t_visibility$t_id<br />$t_moderation</pre>"; $t_id_bookmark = "<a name=\"$t_id\"></a>"; } else { $t_id_view = ' '; |
From: <vb...@us...> - 2002-09-19 05:15:50
|
Update of /cvsroot/webnotes/webnotes/doc In directory usw-pr-cvs1:/tmp/cvs-serv6789/doc Modified Files: ChangeLog Log Message: - Fixed a typo in the name of note_update_visibility() - Added to the phpnet theme the [ actions ] to change the visibility of a note. - Display in phpnet theme the visibility of notes if the user can moderate. - Filtering all notes in the pages based on access rights, rather than only viewing accepted independent of access rights. Index: ChangeLog =================================================================== RCS file: /cvsroot/webnotes/webnotes/doc/ChangeLog,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- ChangeLog 18 Sep 2002 13:17:42 -0000 1.16 +++ ChangeLog 19 Sep 2002 05:15:47 -0000 1.17 @@ -32,6 +32,8 @@ * Added user sign up support ($g_allow_signup) * Added core/enum_api.php to support enumeration strings. * Built infrastructure for multiple access levels. + * Implemented inline moderation where the moderators can moderate notes on the actual pages. + * Viewing notes based on access level rather than displaying all accepted notes for everybody. 03.12.2000 - 1.0.0 |
From: <vb...@us...> - 2002-09-19 05:15:50
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv6789/core Modified Files: config_defaults_inc.php constants_inc.php note_api.php Log Message: - Fixed a typo in the name of note_update_visibility() - Added to the phpnet theme the [ actions ] to change the visibility of a note. - Display in phpnet theme the visibility of notes if the user can moderate. - Filtering all notes in the pages based on access rights, rather than only viewing accepted independent of access rights. Index: config_defaults_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/config_defaults_inc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- config_defaults_inc.php 19 Sep 2002 04:15:48 -0000 1.4 +++ config_defaults_inc.php 19 Sep 2002 05:15:47 -0000 1.5 @@ -147,6 +147,11 @@ ACTION_NOTES_EDIT_OWN => REGISTERED, ACTION_NOTES_DELETE_OWN => REGISTERED, ACTION_NOTES_MODERATE => MODERATOR, + ACTION_NOTES_MODERATE_ACCEPT => MODERATOR, + ACTION_NOTES_MODERATE_DECLINE => MODERATOR, + ACTION_NOTES_MODERATE_ARCHIVE => MODERATOR, + ACTION_NOTES_MODERATE_DELETE => MODERATOR, + ACTION_NOTES_MODERATE_QUEUE => MODERATOR, ACTION_NOTES_PACK_DELETED => NOBODY, ACTION_NOTES_PACK_DECLINED => MODERATOR, ACTION_USERS_MANAGE => ADMINISTRATOR, Index: constants_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/constants_inc.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- constants_inc.php 19 Sep 2002 04:15:48 -0000 1.7 +++ constants_inc.php 19 Sep 2002 05:15:47 -0000 1.8 @@ -29,25 +29,25 @@ define( 'EVERYBODY', 0 ); # Actions - define( 'ACTION_NOTES_VIEW_PENDING', 0 ); - define( 'ACTION_NOTES_VIEW_ACCEPTED', 1 ); - define( 'ACTION_NOTES_VIEW_DECLINED', 2 ); - define( 'ACTION_NOTES_VIEW_ARCHIVED', 3 ); - define( 'ACTION_NOTES_VIEW_DELETED', 4 ); + define( 'ACTION_NOTES_VIEW_PENDING', 0 ); # view pending notes + define( 'ACTION_NOTES_VIEW_ACCEPTED', 1 ); # view accepted notes + define( 'ACTION_NOTES_VIEW_DECLINED', 2 ); # view declined notes + define( 'ACTION_NOTES_VIEW_ARCHIVED', 3 ); # view archived notes + define( 'ACTION_NOTES_VIEW_DELETED', 4 ); # view deleted notes define( 'ACTION_NOTES_SUBMIT', 10 ); # add as pending define( 'ACTION_NOTES_ADD', 11 ); # add as accepted - define( 'ACTION_NOTES_EDIT', 20 ); - define( 'ACTION_NOTES_EDIT_OWN', 21 ); - define( 'ACTION_NOTES_DELETE', 30 ); - define( 'ACTION_NOTES_DELETE_OWN', 31 ); - define( 'ACTION_NOTES_MODERATE', 40 ); - define( 'ACTION_NOTES_MODERATE_PENDING', 41 ); - define( 'ACTION_NOTES_MODERATE_ACCEPTED', 42 ); - define( 'ACTION_NOTES_MODERATE_DECLINED', 43 ); - define( 'ACTION_NOTES_MODERATE_ARCHIVED', 44 ); - define( 'ACTION_NOTES_MODERATE_DELETED', 45 ); - define( 'ACTION_NOTES_PACK_DELETED', 50 ); - define( 'ACTION_NOTES_PACK_DECLINED', 51 ); + define( 'ACTION_NOTES_EDIT', 20 ); # edit all notes that are viewable + define( 'ACTION_NOTES_EDIT_OWN', 21 ); # edit notes submitted by yourself + define( 'ACTION_NOTES_DELETE', 30 ); # delete all notes that are viewable + define( 'ACTION_NOTES_DELETE_OWN', 31 ); # delete notes submitted by yourself + define( 'ACTION_NOTES_MODERATE', 40 ); # can done some moderation + define( 'ACTION_NOTES_MODERATE_QUEUE', 41 ); # move notes to pending state + define( 'ACTION_NOTES_MODERATE_ACCEPT', 42 ); # move notes to accepted state + define( 'ACTION_NOTES_MODERATE_DECLINE', 43 ); # move notes to declined state + define( 'ACTION_NOTES_MODERATE_ARCHIVE', 44 ); # move notes to archived state + define( 'ACTION_NOTES_MODERATE_DELETE', 45 ); # move notes to deleted state + define( 'ACTION_NOTES_PACK_DELETED', 50 ); # purge notes that are marked for deletion + define( 'ACTION_NOTES_PACK_DECLINED', 51 ); # purge notes that are declined define( 'ACTION_USERS_MANAGE', 101 ); define( 'ACTION_USERS_ADD', 102 ); Index: note_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/note_api.php,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- note_api.php 19 Sep 2002 04:15:48 -0000 1.17 +++ note_api.php 19 Sep 2002 05:15:47 -0000 1.18 @@ -41,7 +41,24 @@ return db_query( $query ); } ### -------------------- - function note_update_visiblity( $p_id, $p_visibility ) { + function note_get_visibility_str( $p_visible ) { + switch ( $p_visible ) { + case NOTE_VISIBLE_PENDING: + return "Pending"; + case NOTE_VISIBLE_ACCEPTED: + return "Accepted"; + case NOTE_VISIBLE_DECLINED: + return "Declined"; + case NOTE_VISIBLE_ARCHIVED: + return "Archived"; + case NOTE_VISIBLE_DELETED: + return "Deleted"; + default: + return "Unknown"; + } + } + ### -------------------- + function note_update_visibility( $p_id, $p_visibility ) { $c_id = db_prepare_int( $p_id ); $c_visibility = db_prepare_int( $p_visibility ); @@ -104,23 +121,23 @@ $row = db_fetch_array( $result ); extract( $row, EXTR_PREFIX_ALL, 'v' ); - if ( ( NOTE_VISIBLE_PENDING === $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_PENDING ) === false ) ) { + if ( ( NOTE_VISIBLE_PENDING == $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_PENDING ) === false ) ) { continue; } - if ( ( NOTE_VISIBLE_ACCEPTED === $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_ACCEPTED ) === false ) ) { + if ( ( NOTE_VISIBLE_ACCEPTED == $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_ACCEPTED ) === false ) ) { continue; } - if ( ( NOTE_VISIBLE_DECLINED === $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_DECLINED ) === false ) ) { + if ( ( NOTE_VISIBLE_DECLINED == $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_DECLINED ) === false ) ) { continue; } - if ( ( NOTE_VISIBLE_ARCHIVED === $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_ARCHIVED ) === false ) ) { + if ( ( NOTE_VISIBLE_ARCHIVED == $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_ARCHIVED ) === false ) ) { continue; } - if ( ( NOTE_VISIBLE_DELETED === $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_DELETED ) === false ) ) { + if ( ( NOTE_VISIBLE_DELETED == $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_DELETED ) === false ) ) { continue; } |
From: <vb...@us...> - 2002-09-19 05:15:50
|
Update of /cvsroot/webnotes/webnotes/lang In directory usw-pr-cvs1:/tmp/cvs-serv6789/lang Modified Files: strings_english.php Log Message: - Fixed a typo in the name of note_update_visibility() - Added to the phpnet theme the [ actions ] to change the visibility of a note. - Display in phpnet theme the visibility of notes if the user can moderate. - Filtering all notes in the pages based on access rights, rather than only viewing accepted independent of access rights. Index: strings_english.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/lang/strings_english.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- strings_english.php 18 Sep 2002 12:33:31 -0000 1.8 +++ strings_english.php 19 Sep 2002 05:15:47 -0000 1.9 @@ -96,9 +96,10 @@ ### link_api.php $s_action_accept = 'Accept'; - $s_action_reject = 'Reject'; + $s_action_decline = 'Decline'; $s_action_delete = 'Delete'; $s_action_archive = 'Archive'; + $s_action_queue = 'Queue'; $s_action_edit = 'Edit'; $s_action_index = 'Add Page'; $s_action_unindex = 'Remove Page'; |
From: <vb...@us...> - 2002-09-19 05:15:50
|
Update of /cvsroot/webnotes/webnotes In directory usw-pr-cvs1:/tmp/cvs-serv6789 Modified Files: action.php Log Message: - Fixed a typo in the name of note_update_visibility() - Added to the phpnet theme the [ actions ] to change the visibility of a note. - Display in phpnet theme the visibility of notes if the user can moderate. - Filtering all notes in the pages based on access rights, rather than only viewing accepted independent of access rights. Index: action.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/action.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- action.php 19 Sep 2002 04:15:47 -0000 1.5 +++ action.php 19 Sep 2002 05:15:47 -0000 1.6 @@ -30,7 +30,7 @@ if ( isset( $f_note_id )) { if ( 'accept' === $f_action ) { note_accept( $f_note_id ); - } else if ( 'reject' === $f_action ) { + } else if ( 'decline' === $f_action ) { note_decline( $f_note_id ); } else if ( 'archive' === $f_action ) { note_archive( $f_note_id ); |
From: <vb...@us...> - 2002-09-19 04:15:51
|
Update of /cvsroot/webnotes/webnotes/themes/phpnet In directory usw-pr-cvs1:/tmp/cvs-serv24424/themes/phpnet Modified Files: theme_api.php Log Message: - page_delete_notes() was not executing the query and hence leaving orphan notes. - Added some extra actions for viewing / moderation. - Added visibility states as constants. - Implemented note_accept(), note_pending(), note_decline(), note_archive(), note_delete() and note_pack_deleted(). - Changed some $g_ with config_get(). - Enhanced link_api to support custom captions. For example, the caption may be an image, text, or whatever. - Initial structure to be used for inline moderation. - View notes with different visibility levels based on the access levels. Index: theme_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/themes/phpnet/theme_api.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- theme_api.php 15 Sep 2002 05:08:05 -0000 1.12 +++ theme_api.php 19 Sep 2002 04:15:48 -0000 1.13 @@ -67,10 +67,16 @@ # function. The theme should check that a field is defined in # the array before using it. function theme_notes_echo( $p_page, $p_url, $p_note_info_array, $p_preview = false ) { + if ( access_check_action( ACTION_NOTES_MODERATE ) ) { + # @@@@ replace this with [ actions ] + $t_moderation = "This user can moderator"; + } else { + $t_moderation = ''; + } if ( isset( $p_note_info_array['id'] ) && ( $p_note_info_array['id'] != 0 ) ) { $t_id = '#' . (integer)$p_note_info_array['id']; - $t_id_view = '<pre>' . $t_id . '</pre>'; + $t_id_view = '<pre>' . $t_id . '<br />' . $t_moderation . '</pre>'; $t_id_bookmark = "<a name=\"$t_id\"></a>"; } else { $t_id_view = ' '; @@ -102,7 +108,7 @@ <table summary="" border="0" cellpadding="2" cellspacing="0" width="100%"> <tr valign="top" bgcolor="#e0e0e0"> - <td><strong>$t_email</strong><br/>$t_date</td> + <td><strong>$t_email</strong><br />$t_date</td> <td align="right">$t_id_view</td> </tr> <tr bgcolor="#f0f0f0"> |
From: <vb...@us...> - 2002-09-19 04:15:50
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv24424/core Modified Files: config_defaults_inc.php constants_inc.php link_api.php note_api.php page_api.php Log Message: - page_delete_notes() was not executing the query and hence leaving orphan notes. - Added some extra actions for viewing / moderation. - Added visibility states as constants. - Implemented note_accept(), note_pending(), note_decline(), note_archive(), note_delete() and note_pack_deleted(). - Changed some $g_ with config_get(). - Enhanced link_api to support custom captions. For example, the caption may be an image, text, or whatever. - Initial structure to be used for inline moderation. - View notes with different visibility levels based on the access levels. Index: config_defaults_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/config_defaults_inc.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- config_defaults_inc.php 18 Sep 2002 12:33:31 -0000 1.3 +++ config_defaults_inc.php 19 Sep 2002 04:15:48 -0000 1.4 @@ -136,12 +136,19 @@ # specified set of access levels ($g_access_sets), then it should be set to # NOBODY. $g_access_levels = array( - ACTION_NOTES_VIEW => ANONYMOUS, - ACTION_NOTES_SUBMIT => ANONYMOUS, + ACTION_NOTES_VIEW_PENDING => MODERATOR, + ACTION_NOTES_VIEW_ACCEPTED => EVERYBODY, + ACTION_NOTES_VIEW_DECLINED => MODERATOR, + ACTION_NOTES_VIEW_ARCHIVED => MODERATOR, + ACTION_NOTES_VIEW_DELETED => ADMINISTRATOR, + ACTION_NOTES_SUBMIT => EVERYBODY, + ACTION_NOTES_ADD => MODERATOR, ACTION_NOTES_EDIT => MODERATOR, ACTION_NOTES_EDIT_OWN => REGISTERED, ACTION_NOTES_DELETE_OWN => REGISTERED, ACTION_NOTES_MODERATE => MODERATOR, + ACTION_NOTES_PACK_DELETED => NOBODY, + ACTION_NOTES_PACK_DECLINED => MODERATOR, ACTION_USERS_MANAGE => ADMINISTRATOR, ACTION_USERS_ADD => ADMINISTRATOR, ACTION_USERS_EDIT => ADMINISTRATOR, @@ -154,21 +161,9 @@ # This array specified for each action, the user types that can perform it. # This is more flexible than specifying a threshold. This is only used when # the threshold is set to NOBODY for the specified action. - $g_access_sets = array( - ACTION_NOTES_VIEW => array(), - ACTION_NOTES_SUBMIT => array(), - ACTION_NOTES_EDIT => array(), - ACTION_NOTES_EDIT_OWN => array(), - ACTION_NOTES_DELETE_OWN => array(), - ACTION_NOTES_MODERATE => array(), - ACTION_USERS_MANAGE => array(), - ACTION_USERS_ADD => array(), - ACTION_USERS_EDIT => array(), - ACTION_USERS_EDIT_OWN => array(), - ACTION_USERS_DELETE => array(), - ACTION_PAGES_MANAGE => array(), - ACTION_PAGES_ADD => array(), - ACTION_PAGES_DELETE => array() ); + # Added one example below (although this could have been done by setting + # the threshold to ADMINISTRATOR. + $g_access_sets = array( ACTION_NOTES_PACK_DELETED => array( ADMINISTRATOR ) ); ################### # EMAIL SETTINGS Index: constants_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/constants_inc.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- constants_inc.php 18 Sep 2002 12:33:31 -0000 1.6 +++ constants_inc.php 19 Sep 2002 04:15:48 -0000 1.7 @@ -14,33 +14,55 @@ define( 'ON', 1 ); define( 'OFF', 0 ); - + # Authentication Types define( 'AUTH_PLAIN', 0 ); define( 'AUTH_CRYPT', 1 ); define( 'AUTH_MD5', 2 ); - # User Levels + # User Levels (these are saved in the db) define( 'NOBODY', 100 ); # to disable an action completely (no user has access level 100) define( 'ADMINISTRATOR', 90 ); define( 'MODERATOR', 70 ); define( 'REGISTERED', 40 ); define( 'ANONYMOUS', 10 ); + define( 'EVERYBODY', 0 ); # Actions - define( 'ACTION_NOTES_VIEW', 1 ); - define( 'ACTION_NOTES_SUBMIT', 2 ); - define( 'ACTION_NOTES_EDIT', 3 ); - define( 'ACTION_NOTES_EDIT_OWN', 4 ); - define( 'ACTION_NOTES_DELETE', 5 ); - define( 'ACTION_NOTES_DELETE_OWN', 6 ); - define( 'ACTION_NOTES_MODERATE', 7 ); + define( 'ACTION_NOTES_VIEW_PENDING', 0 ); + define( 'ACTION_NOTES_VIEW_ACCEPTED', 1 ); + define( 'ACTION_NOTES_VIEW_DECLINED', 2 ); + define( 'ACTION_NOTES_VIEW_ARCHIVED', 3 ); + define( 'ACTION_NOTES_VIEW_DELETED', 4 ); + define( 'ACTION_NOTES_SUBMIT', 10 ); # add as pending + define( 'ACTION_NOTES_ADD', 11 ); # add as accepted + define( 'ACTION_NOTES_EDIT', 20 ); + define( 'ACTION_NOTES_EDIT_OWN', 21 ); + define( 'ACTION_NOTES_DELETE', 30 ); + define( 'ACTION_NOTES_DELETE_OWN', 31 ); + define( 'ACTION_NOTES_MODERATE', 40 ); + define( 'ACTION_NOTES_MODERATE_PENDING', 41 ); + define( 'ACTION_NOTES_MODERATE_ACCEPTED', 42 ); + define( 'ACTION_NOTES_MODERATE_DECLINED', 43 ); + define( 'ACTION_NOTES_MODERATE_ARCHIVED', 44 ); + define( 'ACTION_NOTES_MODERATE_DELETED', 45 ); + define( 'ACTION_NOTES_PACK_DELETED', 50 ); + define( 'ACTION_NOTES_PACK_DECLINED', 51 ); + define( 'ACTION_USERS_MANAGE', 101 ); define( 'ACTION_USERS_ADD', 102 ); define( 'ACTION_USERS_EDIT', 103 ); define( 'ACTION_USERS_EDIT_OWN', 104 ); define( 'ACTION_USERS_DELETE', 105 ); + define( 'ACTION_PAGES_MANAGE', 201 ); define( 'ACTION_PAGES_ADD', 202 ); define( 'ACTION_PAGES_DELETE', 203 ); + + # Note Visible States (these are saved in the db) + define( 'NOTE_VISIBLE_PENDING', 0 ); + define( 'NOTE_VISIBLE_ACCEPTED', 1 ); + define( 'NOTE_VISIBLE_DECLINED', 2 ); + define( 'NOTE_VISIBLE_ARCHIVED', 3 ); + define( 'NOTE_VISIBLE_DELETED', 4 ); ?> Index: link_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/link_api.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- link_api.php 11 Sep 2002 09:49:54 -0000 1.3 +++ link_api.php 19 Sep 2002 04:15:48 -0000 1.4 @@ -13,34 +13,51 @@ ########################################################################### ### -------------------- - function link_note_action( $p_note_id, $p_action, $p_url, $p_link_active = true ) { - $t_caption = lang_get( 'action_' . $p_action ); + function link_note_action( $p_note_id, $p_action, $p_url, $p_link_active = true, $p_caption = null ) { + if ( null === $p_caption ) { + $t_caption = lang_get( 'action_' . $p_action ); + $t_before = '[ '; + $t_after = ' ]'; + } else { + $t_caption = $p_caption; + $t_before = $t_after = ''; + } + $c_note_id = db_prepare_int( $p_note_id ); $c_action = urlencode( $p_action ); $c_url = urlencode( $p_url ); $t_action = config_get( 'web_directory') . 'action.php'; - + if ( $p_link_active ) { - return "[ <a href=\"$t_action?f_action=$c_action&f_note_id=$c_note_id&f_url=$c_url\">$t_caption</a> ]"; + $t_link = "$t_action?f_action=$c_action&f_note_id=$c_note_id&f_url=$c_url"; + return $t_before . "<a href=\"$t_link\">$t_caption</a>" . $t_after; } else { - return "[ $t_caption ]"; + return $t_before . $t_caption . $t_after; } } ### -------------------- # $p_page = $p_page_id if action is unindex # $p_page = $p_page_name if action is index - function link_page_action( $p_page, $p_action, $p_url, $p_link_active = true ) { - $t_caption = lang_get( 'action_' . $p_action ); + function link_page_action( $p_page, $p_action, $p_url, $p_link_active = true, $p_caption = null ) { + if ( null === $p_caption ) { + $t_caption = lang_get( 'action_' . $p_action ); + $t_before = '[ '; + $t_after = ' ]'; + } else { + $t_caption = $p_caption; + $t_before = $t_after = ''; + } - $c_page_id = urlencode( $p_page ); + $c_page_id = urlencode( $p_page ); $c_action = urlencode( $p_action ); $c_url = urlencode( $p_url ); - $t_action = config_get( 'web_directory') . 'action.php'; + $t_action = config_get( 'web_directory' ) . 'action.php'; if ( $p_link_active ) { - return "[ <a href=\"$t_action?f_action=$c_action&f_page_id=$c_page_id&f_url=$c_url\">$t_caption</a> ]"; + $t_link = "$t_action?f_action=$c_action&f_page_id=$c_page_id&f_url=$c_url"; + return $t_before . "<a href=\"$t_link\">$t_caption</a>" . $t_after; } else { - return "[ $t_caption ]"; + return $t_before . "$t_caption" . $t_after; } } ?> Index: note_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/note_api.php,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- note_api.php 15 Sep 2002 02:25:58 -0000 1.16 +++ note_api.php 19 Sep 2002 04:15:48 -0000 1.17 @@ -9,25 +9,24 @@ # -------------------------------------------------------- ### -------------------- + # allow an array of visibilities as a parameter function note_queue_count() { - global $g_phpWN_note_table, $g_phpWN_page_table; - # the reason of including the page is to avoid counting orphan # notes. $query = "SELECT COUNT(*) - FROM $g_phpWN_note_table n, $g_phpWN_page_table p - WHERE visible='0' AND n.page_id = p.id"; + FROM " . config_get( 'phpWN_note_table' ) . " n, + " . config_get( 'phpWN_page_table' ) . " p + WHERE n.page_id = p.id AND + visible='" . NOTE_VISIBLE_PENDING . "'"; $result = db_query( $query ); return db_result( $result, 0, 0 ); } ### -------------------- function note_add( $p_page_id, $p_email, $p_remote_addr, $p_note ) { - global $g_phpWN_note_table; - if ( ON == config_get('auto_accept_notes') ) { - $t_visible = 1; + $t_visible = NOTE_VISIBLE_ACCEPTED; } else { - $t_visible = 0; + $t_visible = NOTE_VISIBLE_PENDING; } $c_page_id = db_prepare_int( $p_page_id ); @@ -35,70 +34,69 @@ $c_note = db_prepare_string( $p_note ); $c_remote_address = db_prepare_string( $p_remote_addr ); - $query = "INSERT - INTO $g_phpWN_note_table + $query = "INSERT INTO " . config_get( 'phpWN_note_table' ) . " ( id, page_id, email, ip, date_submitted, note, visible ) VALUES ( null, '$c_page_id', '$c_email', '$c_remote_address', NOW(), '$c_note', '$t_visible' )"; return db_query( $query ); } ### -------------------- - function note_delete( $p_id ) { - global $g_phpWN_note_table; - + function note_update_visiblity( $p_id, $p_visibility ) { $c_id = db_prepare_int( $p_id ); + $c_visibility = db_prepare_int( $p_visibility ); - $query = "DELETE FROM $g_phpWN_note_table - WHERE id='$c_id'"; + $query = "UPDATE " . config_get( 'phpWN_note_table' ) . " + SET visible='$c_visibility' + WHERE id='$c_id' LIMIT 1"; $result = db_query( $query ); } ### -------------------- - function note_update( $p_id, $p_email, $p_note ) { - global $g_phpWN_note_table; - - $c_id = db_prepare_int( $p_id ); - $c_email = db_prepare_string( $p_email ); - $c_note = db_prepare_string( $p_note ); - - $query = "UPDATE $g_phpWN_note_table - SET email='$c_email', note='$c_note' - WHERE id='$c_id'"; - $result = db_query( $query ); + # Put back as pending if approved by default. + function note_pending( $p_id ) { + note_update_visibility( $p_id, NOTE_VISIBLE_PENDING ); } ### -------------------- function note_accept( $p_id ) { - global $g_phpWN_note_table; - - $c_id = db_prepare_int( $p_id ); - $query = "UPDATE $g_phpWN_note_table - SET visible='1' - WHERE id='$c_id'"; - $result = db_query( $query ); + note_update_visibility( $p_id, NOTE_VISIBLE_ACCEPTED ); } ### -------------------- function note_decline( $p_id ) { - global $g_phpWN_note_table; - - $c_id = db_prepare_int( $p_id ); - $query = "DELETE FROM $g_phpWN_note_table - WHERE id='$c_id'"; - $result = db_query( $query ); + note_update_visibility( $p_id, NOTE_VISIBLE_DECLINED ); } ### -------------------- function note_archive( $p_id ) { + note_update_visibility( $p_id, NOTE_VISIBLE_ARCHIVED ); } ### -------------------- - function note_print_all( $p_page_name, $p_url ) { - global $g_phpWN_note_table, $g_phpWN_page_table, - $g_note_order; + function note_delete( $p_id ) { + note_update_visibility( $p_id, NOTE_VISIBLE_DELETED ); + } + ### -------------------- + function note_pack_deleted() { + $query = "DELETE FROM " . config_get( 'phpWN_note_table' ) . " + WHERE visible='" . NOTE_VISIBLE_DELETED ."'"; + $result = db_query( $query ); + } + ### -------------------- + function note_update( $p_id, $p_email, $p_note ) { + $c_id = db_prepare_int( $p_id ); + $c_email = db_prepare_string( $p_email ); + $c_note = db_prepare_string( $p_note ); + $query = "UPDATE " . config_get( 'phpWN_note_table' ) . " + SET email='$c_email', note='$c_note' + WHERE id='$c_id' LIMIT 1"; + $result = db_query( $query ); + } + ### -------------------- + function note_print_all( $p_page_name, $p_url ) { $c_page_name = db_prepare_string( $p_page_name ); $query = "SELECT * - FROM $g_phpWN_page_table p, - $g_phpWN_note_table n - WHERE p.page='$c_page_name' AND n.page_id=p.id AND n.visible='1' - ORDER BY n.date_submitted $g_note_order"; + FROM " . config_get( 'phpWN_page_table' ) . " p, + " . config_get( 'phpWN_note_table' ) . " n + WHERE p.page='$c_page_name' AND n.page_id=p.id + ORDER BY n.date_submitted " . config_get( 'note_order' ); $result = db_query( $query ); $entry_count = db_num_rows( $result ); @@ -106,6 +104,27 @@ $row = db_fetch_array( $result ); extract( $row, EXTR_PREFIX_ALL, 'v' ); + if ( ( NOTE_VISIBLE_PENDING === $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_PENDING ) === false ) ) { + continue; + } + + if ( ( NOTE_VISIBLE_ACCEPTED === $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_ACCEPTED ) === false ) ) { + continue; + } + + if ( ( NOTE_VISIBLE_DECLINED === $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_DECLINED ) === false ) ) { + continue; + } + + if ( ( NOTE_VISIBLE_ARCHIVED === $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_ARCHIVED ) === false ) ) { + continue; + } + + if ( ( NOTE_VISIBLE_DELETED === $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_DELETED ) === false ) ) { + continue; + } + + $info['visible'] = $v_visible; $info['id'] = $v_id; $info['email'] = $v_email; $info['note'] = string_add_note_links( $p_url, string_preserve_spaces( string_disable_html( $v_note ) ) ); @@ -118,15 +137,16 @@ } } ### -------------------- + # @@@@ Should be obsolete soon! function note_queue( $p_only_one = true ) { - global $g_phpWN_note_table, $g_phpWN_page_table; - $query = "SELECT n.id as note_id, n.*, p.page - FROM $g_phpWN_note_table n, $g_phpWN_page_table p - WHERE n.visible='0' AND n.page_id=p.id"; - + FROM " . config_get( 'phpWN_note_table' ) . " n, + " . config_get( 'phpWN_page_table' ) . " p + WHERE n.visible='" . NOTE_VISIBLE_PENDING . "' + AND n.page_id=p.id"; + if ( $p_only_one ) { - $query .= ' LIMIT 1'; + $query .= ' LIMIT 1'; } else { $query .= ' ORDER BY p.page, n.date_submitted'; } @@ -138,14 +158,13 @@ global $g_primary_light_color, $g_primary_dark_color, $g_white_color, $g_header_color, $g_admin_manage_notes, - $g_phpWN_note_table, $s_date, $s_email, $s_ip, $s_note, $s_delete_button, $s_update_button; $c_page_id = db_prepare_int( $p_page_id ); $query = "SELECT * - FROM $g_phpWN_note_table + FROM " . config_get( 'phpWN_note_table' ) . " WHERE page_id='$c_page_id' ORDER BY date_submitted"; $result = db_query( $query ); @@ -215,9 +234,7 @@ $t_page_id = page_get_id( $p_file ); if ( !page_valid_id( $t_page_id ) ) { - global $g_auto_index_pages; - - if ( ON === $g_auto_index_pages ) { + if ( ON === config_get( 'auto_index_pages' ) ) { if ( page_add( $p_file ) ) { print_web_notes( $p_file, $p_url ); return; Index: page_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/page_api.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- page_api.php 11 Sep 2002 09:49:54 -0000 1.9 +++ page_api.php 19 Sep 2002 04:15:48 -0000 1.10 @@ -10,12 +10,10 @@ ### -------------------- function page_get_id( $p_file ) { - global $g_phpWN_page_table; - $c_file = db_prepare_string( $p_file ); $query = "SELECT id - FROM $g_phpWN_page_table + FROM " . config_get( 'phpWN_page_table' ) . " WHERE page='$c_file' LIMIT 1"; @@ -36,36 +34,30 @@ } ### -------------------- function page_visible_notes_count( $p_page_id ) { - global $g_phpWN_note_table; - $c_page_id = db_prepare_int( $p_page_id ); $query = "SELECT COUNT(*) - FROM $g_phpWN_note_table - WHERE page_id=$c_page_id AND visible=1"; + FROM " . config_get( 'phpWN_note_table' ) . " + WHERE page_id='$c_page_id' AND visible='" . NOTE_VISIBLE_ACCEPTED . "'"; $result = db_query( $query ); return db_result( $result, 0, 0 ); } ### -------------------- function page_notes_count( $p_page_id ) { - global $g_phpWN_note_table; - $c_page_id = db_prepare_int( $p_page_id ); $query = "SELECT COUNT(*) - FROM $g_phpWN_note_table - WHERE page_id=$c_page_id"; + FROM " . config_get( 'phpWN_note_table' ) . " + WHERE page_id='$c_page_id'"; $result = db_query( $query ); return db_result( $result, 0, 0 ); } ### -------------------- function page_get_name( $p_page_id ) { - global $g_phpWN_page_table; - $c_page_id = db_prepare_int( $p_page_id ); $query = "SELECT page - FROM $g_phpWN_page_table + FROM " . config_get( 'phpWN_page_table' ) . " WHERE id='$c_page_id' LIMIT 1"; @@ -124,12 +116,9 @@ return 0; } - global $g_phpWN_page_table; - $c_page_name = db_prepare_string( $p_page_name ); - $query = "INSERT INTO - $g_phpWN_page_table + $query = "INSERT INTO " . config_get( 'phpWN_page_table' ) . " ( id, date_indexed, page ) VALUES ( null, NOW(), '$c_page_name' )"; @@ -174,30 +163,28 @@ } ### -------------------- function page_delete_notes( $p_page_id ) { - global $g_phpWN_note_table; - $c_page_id = db_prepare_int( $p_page_id ); - $query = "DELETE FROM $g_phpWN_note_table + $query = "DELETE FROM " . config_get( 'phpWN_note_table' ) . " WHERE page_id='$c_page_id'"; + $result = db_query( $query ); + return true; } ### -------------------- function page_delete( $p_page_id ) { - global $g_phpWN_page_table; + if ( !page_delete_notes( $p_page_id ) ) { + return false; + } $c_page_id = db_prepare_int( $p_page_id ); - $query = "DELETE FROM $g_phpWN_page_table + $query = "DELETE FROM " . config_get( 'phpWN_page_table' ) . " WHERE id='$c_page_id' LIMIT 1"; $result = db_query( $query ); - - if ( !page_delete_notes( $p_page_id ) ) { - return false; - }; return true; } |
From: <vb...@us...> - 2002-09-19 04:15:50
|
Update of /cvsroot/webnotes/webnotes/doc In directory usw-pr-cvs1:/tmp/cvs-serv24424/doc Modified Files: ROADMAP Log Message: - page_delete_notes() was not executing the query and hence leaving orphan notes. - Added some extra actions for viewing / moderation. - Added visibility states as constants. - Implemented note_accept(), note_pending(), note_decline(), note_archive(), note_delete() and note_pack_deleted(). - Changed some $g_ with config_get(). - Enhanced link_api to support custom captions. For example, the caption may be an image, text, or whatever. - Initial structure to be used for inline moderation. - View notes with different visibility levels based on the access levels. Index: ROADMAP =================================================================== RCS file: /cvsroot/webnotes/webnotes/doc/ROADMAP,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ROADMAP 17 Sep 2002 07:04:57 -0000 1.11 +++ ROADMAP 19 Sep 2002 04:15:48 -0000 1.12 @@ -22,18 +22,23 @@ * Support auto-accept mode to be used for Intranet / Demo installations. 2.0.1 + * Bug fixes. * Language Localisation (English, French, Italian, German). - * Any required bug fixes. + +2.0.2 + * Factor out the use of hard-coded formatting / colours and replace with styles. + * Caching / speed optimisations. + * Manual 2.1.0 * Multiple authentication modes - * Multiple access levels (anonymous, verified, moderator, admin) * Add IP/IP range blocking. * LDAP Support - * New Manual + * FAQ * Support direct links to specific notes - * Allow certain HTML tags + * Allow certain HTML tags or bbcodes [url], [b], ...etc. * Ability to assign a set of pages for each moderator to manage. + * Consider replacing cookies with sessions. 3.0.0 * Database abstraction |
From: <vb...@us...> - 2002-09-19 04:15:50
|
Update of /cvsroot/webnotes/webnotes In directory usw-pr-cvs1:/tmp/cvs-serv24424 Modified Files: action.php admin_pending.php Log Message: - page_delete_notes() was not executing the query and hence leaving orphan notes. - Added some extra actions for viewing / moderation. - Added visibility states as constants. - Implemented note_accept(), note_pending(), note_decline(), note_archive(), note_delete() and note_pack_deleted(). - Changed some $g_ with config_get(). - Enhanced link_api to support custom captions. For example, the caption may be an image, text, or whatever. - Initial structure to be used for inline moderation. - View notes with different visibility levels based on the access levels. Index: action.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/action.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- action.php 18 Sep 2002 12:33:31 -0000 1.4 +++ action.php 19 Sep 2002 04:15:47 -0000 1.5 @@ -26,18 +26,25 @@ # @@@@ add handling for confirm? + # The access level check is done in the APIs if ( isset( $f_note_id )) { if ( 'accept' === $f_action ) { - note_accept( $f_note_id ); + note_accept( $f_note_id ); } else if ( 'reject' === $f_action ) { - note_decline( $f_note_id ); + note_decline( $f_note_id ); } else if ( 'archive' === $f_action ) { - note_archive( $f_note_id ); + note_archive( $f_note_id ); } else if ( 'delete' === $f_action ) { - note_delete( $f_note_id ); + note_delete( $f_note_id ); + } else if ( 'pack' === $f_action ) { + # in this case id = 0 + note_pack_deleted(); + } else if ( 'pending' === $f_action ) { + note_pending( $f_note_id ); } } - + + # The access level check is done in the APIs if ( isset( $f_page_id ) ) { $c_page_id = stripslashes( urldecode( $f_page_id ) ); if ( 'unindex' === $f_action ) { Index: admin_pending.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_pending.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- admin_pending.php 18 Sep 2002 12:33:31 -0000 1.4 +++ admin_pending.php 19 Sep 2002 04:15:47 -0000 1.5 @@ -25,6 +25,20 @@ print_admin_menu(); +# +# @@@ Should list here: +# - all pages (sorted by page name) +# - pages with pending notes (sorted descending) +# +# Each page should have the number of accepted notes, declined notes, +# pending notes, archived notes, and deleted notes. +# +# Clicking on a page should open it in another window. +# + + #print_web_notes( 'XML', 'http://webnotes.sf.net/phpWebNotes-2.0.0-dev/sample/xml.php' ); + +/* $result = note_queue( false ); echo '<div align="center">'; @@ -58,6 +72,7 @@ echo '</table>'; } echo '</div>'; +*/ echo '<br />'; print_footer( __FILE__ ); |
From: <vb...@us...> - 2002-09-18 13:35:01
|
Update of /cvsroot/webnotes/webnotes In directory usw-pr-cvs1:/tmp/cvs-serv8578 Modified Files: admin_manage_users.php Log Message: Displaying user access level as a string rather than a number in the admin_manage_users page. Index: admin_manage_users.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_manage_users.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- admin_manage_users.php 18 Sep 2002 12:33:31 -0000 1.2 +++ admin_manage_users.php 18 Sep 2002 13:34:58 -0000 1.3 @@ -35,7 +35,8 @@ foreach ( $t_users_array as $user ) { extract( $user, EXTR_PREFIX_ALL, 'v' ); $t_color = util_alternate_colors( $i++ ); - echo "<tr bgcolor=\"$t_color\"><td>$v_username</td><td>$v_email</td><td>$v_access_level</td><td>$v_enabled</td></tr>"; + $t_access_level = enum_get_element( 'access_levels', $v_access_level ); + echo "<tr bgcolor=\"$t_color\"><td>$v_username</td><td>$v_email</td><td>$t_access_level</td><td>$v_enabled</td></tr>"; } echo '</tbody></table>'; echo '</div>'; |
From: <vb...@us...> - 2002-09-18 13:17:45
|
Update of /cvsroot/webnotes/webnotes/doc In directory usw-pr-cvs1:/tmp/cvs-serv2238/doc Modified Files: ChangeLog Log Message: - Changed the look of the menu. - Customised the menu based on the access level of the logged in user. Index: ChangeLog =================================================================== RCS file: /cvsroot/webnotes/webnotes/doc/ChangeLog,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- ChangeLog 17 Sep 2002 21:51:17 -0000 1.15 +++ ChangeLog 18 Sep 2002 13:17:42 -0000 1.16 @@ -30,6 +30,8 @@ * Added db_upgrade.sql to upgrade the db and include the password field change. * Added support for cross referencing between notes on the same document (#<note number>). * Added user sign up support ($g_allow_signup) + * Added core/enum_api.php to support enumeration strings. + * Built infrastructure for multiple access levels. 03.12.2000 - 1.0.0 |
From: <vb...@us...> - 2002-09-18 13:17:45
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv2238/core Modified Files: html_api.php Log Message: - Changed the look of the menu. - Customised the menu based on the access level of the logged in user. Index: html_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/html_api.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- html_api.php 18 Sep 2002 12:33:31 -0000 1.6 +++ html_api.php 18 Sep 2002 13:17:40 -0000 1.7 @@ -120,16 +120,26 @@ $queue_count = note_queue_count(); - echo <<<EOT - <div class="menu"> - <a href="$g_user_home_page">Home</a> | - <a href="$g_admin_index_files">$s_index_files</a> | - <a href="$g_admin_manage_notes">$s_manage_notes</a> | - <a href="$g_admin_manage_users">$s_manage_users</a> | - <a href="$g_admin_pending">$s_view_queue</a> [$queue_count] | + echo '<div class="menu">.: '; + echo "<a href=\"$g_user_home_page\">Home</a> :: "; + if ( access_check_action( ACTION_PAGES_MANAGE ) ) { + echo "<a href=\"$g_admin_index_files\">$s_index_files</a> :: "; + } + if ( access_check_action( ACTION_NOTES_MODERATE ) ) { + echo "<a href=\"$g_admin_manage_notes\">$s_manage_notes</a> :: "; + } + if ( access_check_action( ACTION_USERS_MANAGE ) ) { + echo "<a href=\"$g_admin_manage_users\">$s_manage_users</a> :: "; + } + if ( access_check_action( ACTION_NOTES_MODERATE ) ) { + echo "<a href=\"$g_admin_pending\">$s_view_queue</a> [$queue_count] :: "; + } + if ( access_check_action( ACTION_USERS_EDIT_OWN ) ) { + echo "<a href=\"$g_admin_change_password\">$s_change_password</a> :: "; + } - <a href="$g_admin_change_password">$s_change_password</a> | - <a href="$g_logout">$s_logout_link</a> +echo <<<EOT + <a href="$g_logout">$s_logout_link</a> :. </div> <br /> EOT; |
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv19524/core Modified Files: access_api.php api.php config_defaults_inc.php constants_inc.php html_api.php Added Files: enum_api.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: enum_api.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: enum_api.php,v 1.1 2002/09/18 12:33:31 vboctor Exp $ # -------------------------------------------------------- # -------------------- # Get the string associated with the $p_enum value function get_enum_to_string( $p_enum_string, $p_num ) { $t_arr = enum_explode_string( $p_enum_string ); $enum_count = count( $t_arr ); for ($i=0;$i<$enum_count;$i++) { $t_s = enum_explode_array( $t_arr[$i] ); if ( $t_s[0] == $p_num ) { return $t_s[1]; } } return '@null@'; } # -------------------- # Breaks up an enum string into num:value elements function enum_explode_string( $p_enum_string ) { return explode( ',', $p_enum_string ); } # -------------------- # Given one num:value pair it will return both in an array # num will be first (element 0) value second (element 1) function enum_explode_array( $p_enum_elem ) { return explode( ':', $p_enum_elem ); } # -------------------- # Given a enum string and num, return the appropriate string function enum_get_element( $p_enum_name, $p_val ) { $config_var = config_get( $p_enum_name.'_enum_string' ); $string_var = lang_get( $p_enum_name.'_enum_string' ); # use the global enum string to search $t_arr = enum_explode_string( $config_var ); $t_arr_count = count( $t_arr ); for ( $i=0;$i<$t_arr_count;$i++ ) { $elem_arr = enum_explode_array( $t_arr[$i] ); if ( $elem_arr[0] == $p_val ) { # now get the appropriate translation return get_enum_to_string( $string_var, $p_val ); } } return '@null@'; } ?> Index: access_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/access_api.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- access_api.php 18 Sep 2002 06:55:02 -0000 1.6 +++ access_api.php 18 Sep 2002 12:33:31 -0000 1.7 @@ -13,10 +13,27 @@ # he/she is not authorised to. This outputs an access denied message then # re-directs to the mainpage. function access_denied( $p_url = null ) { - echo '<div class="error">'; - echo 'Access Denied'; - # print_bracket_link( $p_url, lang_get( 'proceed' ) ); - print '</div>'; + if ( null === $p_url ) { + global $g_logout; + $p_url = $g_logout; + } + + print_html_top(); + print_head_top(); + print_title( config_get( 'window_title' ) ); + print_css( config_get( 'css_inc_file' ) ); + print_head_bottom(); + print_body_top(); + print_header( config_get( 'page_title' ) ); + print_top_page( config_get( 'top_page_inc' ) ); + echo '<div class="warning">'; + echo '<div align="center">Access Denied<br /><br />'; + print_bracket_link( $p_url, lang_get( 'proceed' ) ); + print '</div></div>'; + print_bottom_page( config_get( 'bottom_page_inc' ) ); + print_footer( __FILE__ ); + print_body_bottom(); + print_html_bottom(); exit; } # -------------------- Index: api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/api.php,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- api.php 17 Sep 2002 22:18:24 -0000 1.24 +++ api.php 18 Sep 2002 12:33:31 -0000 1.25 @@ -39,7 +39,9 @@ $g_admin_manage_users = $g_web_directory . 'admin_manage_users' . $g_ext; $g_admin_pending = $g_web_directory . 'admin_pending' . $g_ext; $g_admin_change_password = $g_web_directory . 'admin_change_password' . $g_ext; - $g_admin_page = $g_admin_pending; + + $g_user_home_page = $g_web_directory . 'user_home_page' . $g_ext; + $g_admin_page = $g_user_home_page; $g_css_inc_file = $g_absolute_directory . 'core' . DIRECTORY_SEPARATOR . 'css_inc' . $g_ext; $g_meta_inc_file = $g_absolute_directory . 'core' . DIRECTORY_SEPARATOR . 'meta_inc' . $g_ext; @@ -67,6 +69,7 @@ require_once( $t_path_core . 'util_api.php' ); require_once( $t_path_core . 'gpc_api.php' ); require_once( $t_path_core . 'email_api.php' ); + require_once( $t_path_core . 'enum_api.php' ); require_once( $t_path_main . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $g_theme . DIRECTORY_SEPARATOR . 'theme_api.php' ); Index: config_defaults_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/config_defaults_inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- config_defaults_inc.php 18 Sep 2002 06:55:03 -0000 1.2 +++ config_defaults_inc.php 18 Sep 2002 12:33:31 -0000 1.3 @@ -141,11 +141,15 @@ ACTION_NOTES_EDIT => MODERATOR, ACTION_NOTES_EDIT_OWN => REGISTERED, ACTION_NOTES_DELETE_OWN => REGISTERED, - ACTION_NOTES_ACCEPT => MODERATOR, - ACTION_NOTES_ARCHIVE => MODERATOR, - ACTION_USER_ADD => ADMINISTRATOR, - ACTION_USER_EDIT => ADMINISTRATOR, - ACTION_USER_DELETE => ADMINISTRATOR ); + ACTION_NOTES_MODERATE => MODERATOR, + ACTION_USERS_MANAGE => ADMINISTRATOR, + ACTION_USERS_ADD => ADMINISTRATOR, + ACTION_USERS_EDIT => ADMINISTRATOR, + ACTION_USERS_EDIT_OWN => REGISTERED, + ACTION_USERS_DELETE => ADMINISTRATOR, + ACTION_PAGES_MANAGE => ADMINISTRATOR, + ACTION_PAGES_ADD => ADMINISTRATOR, + ACTION_PAGES_DELETE => ADMINISTRATOR ); # This array specified for each action, the user types that can perform it. # This is more flexible than specifying a threshold. This is only used when @@ -156,11 +160,15 @@ ACTION_NOTES_EDIT => array(), ACTION_NOTES_EDIT_OWN => array(), ACTION_NOTES_DELETE_OWN => array(), - ACTION_NOTES_ACCEPT => array(), - ACTION_NOTES_ARCHIVE => array(), - ACTION_USER_ADD => array(), - ACTION_USER_EDIT => array(), - ACTION_USER_DELETE => array() ); + ACTION_NOTES_MODERATE => array(), + ACTION_USERS_MANAGE => array(), + ACTION_USERS_ADD => array(), + ACTION_USERS_EDIT => array(), + ACTION_USERS_EDIT_OWN => array(), + ACTION_USERS_DELETE => array(), + ACTION_PAGES_MANAGE => array(), + ACTION_PAGES_ADD => array(), + ACTION_PAGES_DELETE => array() ); ################### # EMAIL SETTINGS @@ -195,4 +203,13 @@ # If problems occur when sending mail through your server try turning this OFF # more here: http://pobox.com/~djb/docs/smtplf.html $g_mail_send_crlf = OFF; + + ########################## + # ENUMERATIONS SETTINGS + ########################## + + # --- enum strings ---------------- + # status from $g_status_index-1 to 79 are used for the onboard customization (if enabled) + # directly use Mantis to edit them. + $g_access_levels_enum_string = '10:anonymous,40:registered,70:moderator,90:administrator'; ?> Index: constants_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/constants_inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- constants_inc.php 18 Sep 2002 06:55:03 -0000 1.5 +++ constants_inc.php 18 Sep 2002 12:33:31 -0000 1.6 @@ -34,9 +34,13 @@ define( 'ACTION_NOTES_EDIT_OWN', 4 ); define( 'ACTION_NOTES_DELETE', 5 ); define( 'ACTION_NOTES_DELETE_OWN', 6 ); - define( 'ACTION_NOTES_ACCEPT', 7 ); - define( 'ACTION_NOTES_ARCHIVE', 8 ); - define( 'ACTION_USER_ADD', 51 ); - define( 'ACTION_USER_EDIT', 52 ); - define( 'ACTION_USER_DELETE', 53 ); + define( 'ACTION_NOTES_MODERATE', 7 ); + define( 'ACTION_USERS_MANAGE', 101 ); + define( 'ACTION_USERS_ADD', 102 ); + define( 'ACTION_USERS_EDIT', 103 ); + define( 'ACTION_USERS_EDIT_OWN', 104 ); + define( 'ACTION_USERS_DELETE', 105 ); + define( 'ACTION_PAGES_MANAGE', 201 ); + define( 'ACTION_PAGES_ADD', 202 ); + define( 'ACTION_PAGES_DELETE', 203 ); ?> Index: html_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/html_api.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- html_api.php 14 Sep 2002 15:19:12 -0000 1.5 +++ html_api.php 18 Sep 2002 12:33:31 -0000 1.6 @@ -116,12 +116,13 @@ global $g_logout, $g_admin_index_files, $g_admin_pending, $g_admin_change_password, $g_admin_manage_notes, $g_admin_manage_users, $s_logout_link, $s_index_files, $s_view_queue, $s_change_password, - $s_manage_notes, $s_manage_users; + $s_manage_notes, $s_manage_users, $g_user_home_page; $queue_count = note_queue_count(); echo <<<EOT <div class="menu"> + <a href="$g_user_home_page">Home</a> | <a href="$g_admin_index_files">$s_index_files</a> | <a href="$g_admin_manage_notes">$s_manage_notes</a> | <a href="$g_admin_manage_users">$s_manage_users</a> | @@ -132,5 +133,15 @@ </div> <br /> EOT; + } + # -------------------- + # print the bracketed links used near the top + # if the $p_link is blank then the text is printed but no link is created + function print_bracket_link( $p_link, $p_url_text ) { + if ( empty( $p_link ) ) { + echo "[ $p_url_text ]"; + } else { + echo "[ <a href=\"$p_link\">$p_url_text</a> ]"; + } } ?> |
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 ); |
From: <vb...@us...> - 2002-09-18 12:33:34
|
Update of /cvsroot/webnotes/webnotes/lang In directory usw-pr-cvs1:/tmp/cvs-serv19524/lang Modified Files: strings_english.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. Index: strings_english.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/lang/strings_english.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- strings_english.php 14 Sep 2002 15:19:12 -0000 1.7 +++ strings_english.php 18 Sep 2002 12:33:31 -0000 1.8 @@ -102,4 +102,10 @@ $s_action_edit = 'Edit'; $s_action_index = 'Add Page'; $s_action_unindex = 'Remove Page'; + + ### General Strings + $s_proceed = 'Click here to proceed'; + + ### Enumerations + $s_access_levels_enum_string = '10:anonymous,40:registered,70:moderator,90:administrator'; ?> |
From: <vb...@us...> - 2002-09-18 06:55:07
|
Update of /cvsroot/webnotes/webnotes In directory usw-pr-cvs1:/tmp/cvs-serv18631 Modified Files: note_add.php note_add_page.php Log Message: Started working on the access levels infrastructure Index: note_add.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/note_add.php,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- note_add.php 13 Sep 2002 07:17:53 -0000 1.14 +++ note_add.php 18 Sep 2002 06:55:02 -0000 1.15 @@ -10,6 +10,8 @@ require_once( 'core' . DIRECTORY_SEPARATOR . 'api.php' ); + #access_ensure_check_action( ACTION_NOTES_SUBMIT ); + $f_page_id = gpc_get_int( 'f_page_id' ); $f_email = stripslashes( gpc_get_string( 'f_email' ) ); $f_note = stripslashes( gpc_get_string( 'f_note' ) ); Index: note_add_page.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/note_add_page.php,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- note_add_page.php 15 Sep 2002 13:20:56 -0000 1.16 +++ note_add_page.php 18 Sep 2002 06:55:02 -0000 1.17 @@ -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 ); |