b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (CVS HEAD) [ class tree: main ] [ index: main ] [ all elements ]

Source for file settings.ctrl.php

Documentation is available at settings.ctrl.php

  1. <?php
  2.  
  3. if!defined('EVO_CONFIG_LOADED') ) die'Please, do not access this page directly.' );
  4.  
  5. global $demo_mode;
  6.  
  7. $AdminUI->set_path'users''usersettings''usersettings' );
  8.  
  9.  
  10. switch $action )
  11. {
  12.     case 'update':
  13.         // Check that this action request is not a CSRF hacked request:
  14.         $Session->assert_received_crumb'usersettings' );
  15.  
  16.         // Check permission:
  17.         $current_User->check_perm'options''edit'true );
  18.  
  19.         // UPDATE general settings:
  20.  
  21.         param'allow_avatars''integer');
  22.         $Settings->set'allow_avatars'$allow_avatars );
  23.  
  24.         param'uset_nickname_editing''string''edited-user' );
  25.         if$demo_mode )
  26.         {
  27.             $uset_multiple_sessions 'always';
  28.             $Messages->add'Demo mode requires multiple sessions setting to be set to always.''note' );
  29.         }
  30.         else
  31.         {
  32.             param'uset_multiple_sessions''string''default-no' );
  33.         }
  34.  
  35.         $Settings->set_arrayarray(
  36.                                     array'nickname_editing'$uset_nickname_editing ),
  37.                                     array'multiple_sessions'$uset_multiple_sessions ) ) );
  38.  
  39.         if$Messages->count('error') )
  40.         {
  41.             if$Settings->dbupdate() )
  42.             {
  43.                 $Messages->addT_('General settings updated.')'success' );
  44.             }
  45.         }
  46.         
  47.         // Redirect so that a reload doesn't write to the DB twice:
  48.         header_redirect'?ctrl=usersettings'303 )// Will EXIT
  49.         // We have EXITed already at this point!!
  50.  
  51.         break;
  52. }
  53.  
  54.  
  55. $AdminUI->breadcrumbpath_initfalse );  // fp> I'm playing with the idea of keeping the current blog in the path here...
  56. $AdminUI->breadcrumbpath_addT_('Users')'?ctrl=users' );
  57. $AdminUI->breadcrumbpath_addT_('Settings')'?ctrl=settings' );
  58. $AdminUI->breadcrumbpath_addT_('User latitude')'?ctrl=usersettings' );
  59.  
  60.  
  61. // Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
  62. $AdminUI->disp_html_head();
  63.  
  64. // Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
  65. $AdminUI->disp_body_top();
  66.  
  67. // Begin payload block:
  68. $AdminUI->disp_payload_begin();
  69.  
  70. // Display VIEW:
  71. $AdminUI->disp_view'users/views/_settings.form.php' );
  72.  
  73. // End payload block:
  74. $AdminUI->disp_payload_end();
  75.  
  76. // Display body bottom, debug info and close </html>:
  77. $AdminUI->disp_global_footer();
  78.  
  79. /*
  80.  * $Log: settings.ctrl.php,v $
  81.  * Revision 1.8  2010/01/16 14:27:04  efy-yury
  82.  * crumbs, fadeouts, redirect, action_icon
  83.  *
  84.  * Revision 1.7  2010/01/03 17:45:21  fplanque
  85.  * crumbs & stuff
  86.  *
  87.  * Revision 1.6  2009/12/12 19:14:08  fplanque
  88.  * made avatars optional + fixes on img props
  89.  *
  90.  * Revision 1.5  2009/12/06 22:55:19  fplanque
  91.  * Started breadcrumbs feature in admin.
  92.  * Work in progress. Help welcome ;)
  93.  * Also move file settings to Files tab and made FM always enabled
  94.  *
  95.  * Revision 1.4  2009/11/12 00:46:34  fplanque
  96.  * doc/minor/handle demo mode
  97.  *
  98.  * Revision 1.3  2009/10/25 19:24:51  efy-maxim
  99.  * multiple_sessions param
  100.  *
  101.  * Revision 1.2  2009/10/25 19:20:30  efy-maxim
  102.  * users settings
  103.  *
  104.  * Revision 1.1  2009/10/25 18:22:14  efy-maxim
  105.  * users setting controller
  106.  *
  107.  */
  108. ?>

Documentation generated on Sat, 06 Mar 2010 03:57:22 +0100 by phpDocumentor 1.4.2. This site is hosted and maintained by Daniel HAHLER (Contact).