b2evolution PHP Cross Reference Blogging Systems

Source: /inc/messaging/msg_settings.ctrl.php - 87 lines - 2947 bytes - Text - Print

Description: This file is part of b2evolution - {@link http://b2evolution.net/} See also {@link http://sourceforge.net/projects/evocms/}.

   1  <?php
   2  /**
   3   * This file is part of b2evolution - {@link http://b2evolution.net/}
   4   * See also {@link http://sourceforge.net/projects/evocms/}.
   5   *
   6   * @copyright (c)2009-2014 by Francois PLANQUE - {@link http://fplanque.net/}
   7   * Parts of this file are copyright (c)2009 by The Evo Factory - {@link http://www.evofactory.com/}.
   8   *
   9   * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
  10   *
  11   * {@internal Open Source relicensing agreement:
  12   * The Evo Factory grants Francois PLANQUE the right to license
  13   * The Evo Factory's contributions to this file and the b2evolution project
  14   * under any OSI approved OSS license (http://www.opensource.org/licenses/).
  15   * }}
  16   *
  17   * @package messaging
  18   *
  19   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  20   * @author efy-asimo: Attila Simo.
  21   *
  22   * @version $Id: msg_settings.ctrl.php 6136 2014-03-08 07:59:48Z manuel $
  23   */
  24  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  25  
  26  /**
  27   * @var User
  28   */
  29  global $DB, $current_User, $Settings;
  30  
  31  // Check minimum permission:
  32  $current_User->check_perm( 'options', 'edit', true );
  33  
  34  // Set options path:
  35  $AdminUI->set_path( 'messaging', 'msgsettings' );
  36  
  37  // Get action parameter from request:
  38  param_action();
  39  
  40  switch ( $action )
  41  {
  42      case 'update':
  43          // Check that this action request is not a CSRF hacked request:
  44          $Session->assert_received_crumb( 'msgsettings' );
  45  
  46          $Settings->set( 'messages_link_to', param( 'messages_link_to', 'string', true ) );
  47  
  48          // Check user login for existing
  49          $UserCache = & get_UserCache();
  50          $User = $UserCache->get_by_login( param( 'welcomepm_from', 'string', true ) );
  51          if( !$User )
  52          {    // Use login of the current user if user login is incorrect
  53              $User = $current_User;
  54          }
  55  
  56          $Settings->set( 'welcomepm_enabled', param( 'welcomepm_enabled', 'integer', 0 ) );
  57          $Settings->set( 'welcomepm_from', $User->login );
  58          $Settings->set( 'welcomepm_title', param( 'welcomepm_title', 'string', true ) );
  59          $Settings->set( 'welcomepm_message', param( 'welcomepm_message', 'text', true ) );
  60  
  61          $Settings->dbupdate();
  62  
  63          $Messages->add( T_( 'Settings were updated.' ), 'success' );
  64          break;
  65  }
  66  
  67  $AdminUI->breadcrumbpath_init( false );  // fp> I'm playing with the idea of keeping the current blog in the path here...
  68  $AdminUI->breadcrumbpath_add( T_('Messages'), '?ctrl=threads' );
  69  $AdminUI->breadcrumbpath_add( T_('Settings'), '?ctrl=msgsettings' );
  70  
  71  // Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
  72  $AdminUI->disp_html_head();
  73  
  74  // Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
  75  $AdminUI->disp_body_top();
  76  
  77  $AdminUI->disp_payload_begin();
  78  
  79  // Display messaging settings:
  80  $AdminUI->disp_view( 'messaging/views/_msg_settings.form.php' );
  81  
  82  $AdminUI->disp_payload_end();
  83  
  84  // Display body bottom, debug info and close </html>:
  85  $AdminUI->disp_global_footer();
  86  
  87  ?>

title

Description

title

Description

title

Description

title

title

Body