From: John Graham-C. <jgr...@us...> - 2005-02-13 02:16:45
|
Update of /cvsroot/popfile/engine/skins/default In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25558/skins/default Modified Files: advanced-page.thtml common-middle.thtml history-bar.thtml style.css Log Message: More work on v0.23.0 (Multi-user Support) Add the 'Users' tab that is available only to administrators and allows them to create, remove and edit users. Users can be created as a clone of an existing user and the complete list of user parameters can be edited by the administrator. There is currently no way to use this information in POPFile (that's for my next commit); POPFile is still hard-wired to use any information related to user 1 (admin). ---- Classifier/Bayes.pm: Make the cache of user parameter values have entries for whether the value is default or not and also keep track of the last time that the cache entry was read or written so that later we can implementing culling of the cache to save space. New APIs added that are accessible by authenticated administrators: create_user (with optional cloning of another user), remove_user, get_user_list (returns a list of all users), get_user_parameter_list (returns the list of all parameters a user can have), get_user_id (returns the database ID for a named user). Add get_user_parameter as way to get a user parameter for the authenticated user. Change signature of get_user_parameter_from_id so that it returns both the value and whether the value is the default or not. POPFile/Module.pm: Update user_module_config_ because of the change in the signature of get_user_parameter_from_id. UI/HTML.pm: Add support for the users_page (using the users-page.thtml template) and handle create, remove and edit of users. New functions status_message__ and error_message__ are used to set a status or error message using the common-middle.thtml bars at the top of the UI. The intention is that all status and error messages are displayed in a standard place. languages/English.msg: Add strings needed by the new Users page. skins/default/style.css: New styles shellStatusMessage and shellErrorMessage for styling the display of status and error messages. The HTML for this is in common-middle.thtml. Remove DOS-style line endings. skins/default/common-middle.thtml: Add bars at the top of the screen above the tabs that can be used to display status and error messages. skins/default/advanced-page.thtml: Left justify the column headers on the list of user parameters because it looks better. skins/default/history-bar.thtml: Remove error messages that are now handled in HTML.pm by calling error_message__ with the appropriate error string. skins/default/users-page.thtml: Add HTML to handle the Users page. ---- TODO: Go through code and make all errors and status message use the new status_message__ and error_message__ functions in HTML. TODO: Cache flushing of user parameters in Bayes. TODO: New Bayes API functions need tests Index: advanced-page.thtml =================================================================== RCS file: /cvsroot/popfile/engine/skins/default/advanced-page.thtml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** advanced-page.thtml 7 Feb 2005 08:05:51 -0000 1.11 --- advanced-page.thtml 13 Feb 2005 02:16:35 -0000 1.12 *************** *** 66,71 **** <table width="100%"> <tr> ! <th width="50%"><TMPL_VAR NAME="Localize_Advanced_Parameter"></th> ! <th width="50%"><TMPL_VAR NAME="Localize_Advanced_Value"></th> </tr> --- 66,71 ---- <table width="100%"> <tr> ! <th width="50%" align="left"><TMPL_VAR NAME="Localize_Advanced_Parameter"></th> ! <th width="50%" align="left"><TMPL_VAR NAME="Localize_Advanced_Value"></th> </tr> Index: common-middle.thtml =================================================================== RCS file: /cvsroot/popfile/engine/skins/default/common-middle.thtml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** common-middle.thtml 6 Jan 2005 14:57:04 -0000 1.7 --- common-middle.thtml 13 Feb 2005 02:16:35 -0000 1.8 *************** *** 25,28 **** --- 25,36 ---- </table> <br /> + <TMPL_IF NAME="Header_If_Message"> + <table class="shellStatusMessage" width="100%"><tr class="shellStatusRow"><td><TMPL_VAR NAME="Header_Message"></td></tr></table> + <br /> + </TMPL_IF> + <TMPL_IF NAME="Header_If_Error"> + <table class="shellErrorMessage" width="100%"><tr class="shellErrorRow"><td><TMPL_VAR NAME="Header_Error"></td></tr></table> + <br /> + </TMPL_IF> <table class="menu" cellspacing="0" summary="<TMPL_VAR NAME="Localize_Header_MenuSummary>"> <tr> *************** *** 46,49 **** --- 54,61 ---- <td class="menuSpacer"></td> <td class="<TMPL_VAR NAME="Common_Middle_Tab5">" align="center"> + <a class="menuLink" href="/users?session=<TMPL_VAR NAME="Session_Key">"><TMPL_VAR NAME="Localize_Header_Users"></a> + </td> + <td class="menuSpacer"></td> + <td class="<TMPL_VAR NAME="Common_Middle_Tab6">" align="center"> <a class="menuLink" href="/advanced?session=<TMPL_VAR NAME="Session_Key">"><TMPL_VAR NAME="Localize_Header_Advanced"></a> </td> Index: history-bar.thtml =================================================================== RCS file: /cvsroot/popfile/engine/skins/default/history-bar.thtml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** history-bar.thtml 9 Feb 2005 10:45:35 -0000 1.11 --- history-bar.thtml 13 Feb 2005 02:16:35 -0000 1.12 *************** *** 43,56 **** <input type="hidden" name="session" value="<TMPL_VAR NAME="Session_Key">" /> - <TMPL_IF NAME="Configuration_If_Page_Size_Error"> - - <blockquote> - <div class="error01"> - <TMPL_VAR NAME="Localize_Configuration_Error4"> - </div> - </blockquote> - - </TMPL_IF> - </div> <div class="configBarOption"> --- 43,46 ---- *************** *** 66,78 **** <input type="submit" class="submit" name="update_history_days" value="<TMPL_VAR NAME="Localize_Apply">" /> - <TMPL_IF NAME="Configuration_If_History_Days_Error"> - - <blockquote> - <div class="error01"> - <TMPL_VAR NAME="Localize_Configuration_Error5"> - </div> - </blockquote> - - </TMPL_IF> </div> </form> --- 56,59 ---- Index: style.css =================================================================== RCS file: /cvsroot/popfile/engine/skins/default/style.css,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** style.css 10 Feb 2005 19:44:40 -0000 1.13 --- style.css 13 Feb 2005 02:16:35 -0000 1.14 *************** *** 1,273 **** ! /*********************************************************/ ! /* Main Body */ ! ! body { ! color: #000000; ! background-color: #FFFFFF; ! font-family: sans-serif; ! font-size: 100%; ! } ! ! /*********************************************************/ ! /* Shell structure */ ! ! .shell, .shellTop { ! color: #000000; ! background-color: #EDEDCA; ! border: 3px #CCCC99 solid; ! } ! ! table.head { ! width: 100%; ! } ! ! td.head { ! font-weight: normal; ! font-size: 1.8em; ! } ! ! table.footer { ! width: 100%; ! } ! ! td.footerBody { ! text-align: center; ! } ! ! td.naked { ! padding: 0; ! margin: 0; ! border: 0; ! } ! ! td.logo2menuSpace { ! height: 0.8em; ! } ! ! /*********************************************************/ ! /* Menu Settings */ ! ! .menu { ! font-size: 1.2em; ! font-weight: bold; ! width: 100%; ! } ! ! .menuSelected { ! color: #000000; ! background-color: #CCCC99; ! width: 14%; ! } ! ! .menuStandard { ! color: #000000; ! background-color: #EDEDCA; ! width: 14%; ! } ! ! .menuIndent { ! width: 8%; ! } ! ! .menuLink { ! display: block; ! width: 100%; ! } ! ! /*********************************************************/ ! /* Table Settings */ ! ! .settingsTable { ! border: 1px solid #CCCC99; ! } ! ! .settingsPanel { ! border: 1px solid #CCCC99; ! } ! ! .openMessageTable { ! border: 3px solid #CCCC99; ! } ! ! td.openMessageBody { ! text-align: left; ! } ! ! td.openMessageCloser { ! text-align: right; ! } ! ! tr.rowEven { ! color: #000000; ! background-color: #EDEDCA; ! } ! ! tr.rowOdd { ! color: #000000; ! background-color: #DFDFAF; ! } ! ! tr.rowHighlighted { ! color: #000000; ! background-color: #B7B7B7; ! } ! ! tr.rowBoundary { ! color: #000000; ! background-color: #AFAF7F; ! } ! ! .lookupResultsTable { ! border: 3px solid #CCCC99; ! } ! ! tr.rowBoundary { ! background-color: #CCCC99; ! } ! ! /*********************************************************/ ! /* Graphics */ ! ! span.graphFont { ! font-size: x-small; ! } ! ! /*********************************************************/ ! /* Messages */ ! ! div.error01 { ! background-color: transparent; ! color: red; ! font-size: larger; ! } ! ! div.error02 { ! background-color: transparent; ! color: red; ! } ! ! div.helpMessage { ! background-color: #DFDFAF; ! border: 2px solid #CCCC99; ! padding: 0.4em; ! padding-bottom: 0; ! } ! ! /*********************************************************/ ! /* Form Labels */ ! ! .historyLabel { ! font-weight: bold; ! } ! ! .historyLabelSort { ! font-weight: bold; ! font-style: normal; ! } ! ! .bucketsLabel { ! font-weight: bold; ! } ! ! .magnetsLabel { ! font-weight: bold; ! } ! ! .securityLabel { ! font-weight: bold; ! } ! ! .configurationLabel { ! font-weight: bold; ! } ! ! .advancedLabel { ! font-weight: bold; ! } ! ! .passwordLabel { ! font-weight: bold; ! } ! ! .sessionLabel { ! font-weight: bold; ! } ! ! .bucketsWidgetStateOn, .bucketsWidgetStateOff { ! font-weight: bold; ! } ! ! .configWidgetStateOn, .configWidgetStateOff { ! font-weight: bold; ! } ! ! .securityWidgetStateOn, .securityWidgetStateOff { ! font-weight: bold; ! } ! ! /*********************************************************/ ! /* Positioning */ ! ! table.historyWidgetsTop { ! width: 100%; ! margin-left: 1.5em; ! margin-top: 0.6em; ! margin-bottom: 1.0em; ! } ! ! table.historyWidgetsBottom { ! width: 100%; ! margin-top: 0.6em; ! } ! ! .historyNavigatorTop, .historyNavigatorBottom { ! text-align: right; ! } ! ! .magnetsTable caption { ! text-align: left; ! } ! ! /*********************************************************/ ! /* Config Bars */ ! ! .configBar { ! background-color: #DFDFAF; ! border: 1px solid #CCCC99; ! margin-top: 0.5em; ! } ! ! .configBar td { ! border: 1px solid #CCCC99; ! } ! ! .configBar form { ! margin: 0; ! } ! ! .configBarOption { ! border: 1px solid #CCCC99; ! margin: 0.3em; ! padding: 0.3em; ! display: inline; ! float: left; ! min-height: 3em; ! } ! ! .toggleConfigBar { ! float: right; ! border: 0; ! } ! ! .checkLabel { ! border: 1px solid #CCCC99; ! white-space: nowrap; ! } ! ! .configBar input.submit { ! margin-top: 4px; ! } ! ! .configBar label.configurationLabel { ! display: block; ! } --- 1,285 ---- ! /*********************************************************/ ! /* Main Body */ ! ! body { ! color: #000000; ! background-color: #FFFFFF; ! font-family: sans-serif; ! font-size: 100%; ! } ! ! /*********************************************************/ ! /* Shell structure */ ! ! .shell, .shellTop { ! color: #000000; ! background-color: #EDEDCA; ! border: 3px #CCCC99 solid; ! } ! ! .shellStatusMessage { ! color: #000000; ! background-color: #EDEDCA; ! border: 3px #CCCC99 solid; ! } ! ! .shellErrorMessage { ! color: #FF0000; ! background-color: #EDEDCA; ! border: 3px #CCCC99 solid; ! } ! ! table.head { ! width: 100%; ! } ! ! td.head { ! font-weight: normal; ! font-size: 1.8em; ! } ! ! table.footer { ! width: 100%; ! } ! ! td.footerBody { ! text-align: center; ! } ! ! td.naked { ! padding: 0; ! margin: 0; ! border: 0; ! } ! ! td.logo2menuSpace { ! height: 0.8em; ! } ! ! /*********************************************************/ ! /* Menu Settings */ ! ! .menu { ! font-size: 1.2em; ! font-weight: bold; ! width: 100%; ! } ! ! .menuSelected { ! color: #000000; ! background-color: #CCCC99; ! width: 14%; ! } ! ! .menuStandard { ! color: #000000; ! background-color: #EDEDCA; ! width: 14%; ! } ! ! .menuIndent { ! width: 8%; ! } ! ! .menuLink { ! display: block; ! width: 100%; ! } ! ! /*********************************************************/ ! /* Table Settings */ ! ! .settingsTable { ! border: 1px solid #CCCC99; ! } ! ! .settingsPanel { ! border: 1px solid #CCCC99; ! } ! ! .openMessageTable { ! border: 3px solid #CCCC99; ! } ! ! td.openMessageBody { ! text-align: left; ! } ! ! td.openMessageCloser { ! text-align: right; ! } ! ! tr.rowEven { ! color: #000000; ! background-color: #EDEDCA; ! } ! ! tr.rowOdd { ! color: #000000; ! background-color: #DFDFAF; ! } ! ! tr.rowHighlighted { ! color: #000000; ! background-color: #B7B7B7; ! } ! ! tr.rowBoundary { ! color: #000000; ! background-color: #AFAF7F; ! } ! ! .lookupResultsTable { ! border: 3px solid #CCCC99; ! } ! ! tr.rowBoundary { ! background-color: #CCCC99; ! } ! ! /*********************************************************/ ! /* Graphics */ ! ! span.graphFont { ! font-size: x-small; ! } ! ! /*********************************************************/ ! /* Messages */ ! ! div.error01 { ! background-color: transparent; ! color: red; ! font-size: larger; ! } ! ! div.error02 { ! background-color: transparent; ! color: red; ! } ! ! div.helpMessage { ! background-color: #DFDFAF; ! border: 2px solid #CCCC99; ! padding: 0.4em; ! padding-bottom: 0; ! } ! ! /*********************************************************/ ! /* Form Labels */ ! ! .historyLabel { ! font-weight: bold; ! } ! ! .historyLabelSort { ! font-weight: bold; ! font-style: normal; ! } ! ! .bucketsLabel { ! font-weight: bold; ! } ! ! .magnetsLabel { ! font-weight: bold; ! } ! ! .securityLabel { ! font-weight: bold; ! } ! ! .configurationLabel { ! font-weight: bold; ! } ! ! .advancedLabel { ! font-weight: bold; ! } ! ! .passwordLabel { ! font-weight: bold; ! } ! ! .sessionLabel { ! font-weight: bold; ! } ! ! .bucketsWidgetStateOn, .bucketsWidgetStateOff { ! font-weight: bold; ! } ! ! .configWidgetStateOn, .configWidgetStateOff { ! font-weight: bold; ! } ! ! .securityWidgetStateOn, .securityWidgetStateOff { ! font-weight: bold; ! } ! ! /*********************************************************/ ! /* Positioning */ ! ! table.historyWidgetsTop { ! width: 100%; ! margin-left: 1.5em; ! margin-top: 0.6em; ! margin-bottom: 1.0em; ! } ! ! table.historyWidgetsBottom { ! width: 100%; ! margin-top: 0.6em; ! } ! ! .historyNavigatorTop, .historyNavigatorBottom { ! text-align: right; ! } ! ! .magnetsTable caption { ! text-align: left; ! } ! ! /*********************************************************/ ! /* Config Bars */ ! ! .configBar { ! background-color: #DFDFAF; ! border: 1px solid #CCCC99; ! margin-top: 0.5em; ! } ! ! .configBar td { ! border: 1px solid #CCCC99; ! } ! ! .configBar form { ! margin: 0; ! } ! ! .configBarOption { ! border: 1px solid #CCCC99; ! margin: 0.3em; ! padding: 0.3em; ! display: inline; ! float: left; ! min-height: 3em; ! } ! ! .toggleConfigBar { ! float: right; ! border: 0; ! } ! ! .checkLabel { ! border: 1px solid #CCCC99; ! white-space: nowrap; ! } ! ! .configBar input.submit { ! margin-top: 4px; ! } ! ! .configBar label.configurationLabel { ! display: block; ! } |