B2evolution 1.6 2005 11 25 > B2evolution / Blogs / Admin / Features.php

Questions? Need Help? Want to share? » PHP Forum
Script Name:
B2evolution 1.6 2005 11 25

Download:
b2evolution-1.6-2005-11-25.zip

Category:
Blog

Archive Content:

B2evolution > Blogs

B2evolution > Blogs > Admin

B2evolution > Blogs > Admin > Img

B2evolution > Blogs > Admin

B2evolution > Blogs > Admin > Skins

B2evolution > Blogs > Admin > Skins > Evo

B2evolution > Blogs > Admin > Skins > Evo > Rsc

B2evolution > Blogs > Admin > Skins > Evo > Rsc > Css

B2evolution > Blogs > Admin > Skins > Evo > Rsc

B2evolution > Blogs > Admin > Skins > Legacy

B2evolution > Blogs > Admin > Skins > Legacy > Rsc

B2evolution > Blogs > Admin > Skins > Legacy > Rsc > Css

B2evolution > Blogs > Admin

B2evolution > Blogs > Conf

B2evolution > Blogs

B2evolution > Blogs > Evocore

B2evolution > Blogs > Htsrv

B2evolution > Blogs > Htsrv > Rsc

B2evolution > Blogs > Htsrv > Rsc > Css

B2evolution > Blogs > Htsrv > Rsc > Icons

B2evolution > Blogs > Htsrv

B2evolution > Blogs > Img

B2evolution > Blogs > Img > Flags

B2evolution > Blogs > Img > Flags > H10px

B2evolution > Blogs > Img > Flags > W16px

B2evolution > Blogs > Img

B2evolution > Blogs > Img > Smilies

B2evolution > Blogs > Img

B2evolution > Blogs

B2evolution > Blogs > Install

B2evolution > Blogs > Lib

B2evolution > Blogs > Locales

B2evolution > Blogs > Locales > De DE

B2evolution > Blogs > Locales > De DE > LC MESSAGES

B2evolution > Blogs > Locales > Fr FR

B2evolution > Blogs > Locales > Fr FR > LC MESSAGES

B2evolution > Blogs > Locales > Ja JP

B2evolution > Blogs > Locales > Ja JP > LC MESSAGES

B2evolution > Blogs > Locales

B2evolution > Blogs > Media

B2evolution > Blogs > Media > Blogs

B2evolution > Blogs > Media

B2evolution > Blogs > Media > Users

B2evolution > Blogs

B2evolution > Blogs > Plugins

B2evolution > Blogs > Rsc

B2evolution > Blogs > Rsc > Css

B2evolution > Blogs > Rsc > Icons

B2evolution > Blogs > Rsc > Icons > Fileicons

B2evolution > Blogs > Rsc > Icons

B2evolution > Blogs > Rsc > Js

B2evolution > Blogs

B2evolution > Blogs > Skins

B2evolution > Blogs > Skins > Atom

B2evolution > Blogs > Skins

B2evolution > Blogs > Skins > Rdf

B2evolution > Blogs > Skins > Rss

B2evolution > Blogs > Skins > Rss2

B2evolution > Blogs > Skins

B2evolution > Blogs > Skins > Basic

B2evolution > Blogs > Skins > Basic > Img

B2evolution > Blogs > Skins > Bluesky

B2evolution > Blogs > Skins > Bluesky > Img

B2evolution > Blogs > Skins > Custom

B2evolution > Blogs > Skins > Custom > Img

B2evolution > Blogs > Skins > Guadeloupe

B2evolution > Blogs > Skins > Guadeloupe > Img

B2evolution > Blogs > Skins > Natural Pink

B2evolution > Blogs > Skins > Natural Pink > Rsc

B2evolution > Blogs > Skins > Natural Pink > Rsc > Img

B2evolution > Blogs > Skins > Natural Pink > Rsc

B2evolution > Blogs > Skins > Nifty Corners

B2evolution > Blogs > Skins > Nifty Corners > Rsc

B2evolution > Blogs > Skins > Nifty Corners > Rsc > Img

B2evolution > Blogs > Skins > Nifty Corners > Rsc

B2evolution > Blogs > Skins > Originalb2

B2evolution > Blogs > Skins > Wpc Aubmach

B2evolution > Blogs > Skins > Wpc Default

B2evolution > Blogs

B2evolution > Blogs > Xmlsrv

B2evolution > Doc

B2evolution > Extras

B2evolution > Extras > Geeklog

B2evolution > Gettext

B2evolution > Gettext > Langfiles

B2evolution > Gettext

B2evolution

Features.php:


<?php
/**
 * This file implements the UI controller for Global Features.
 *
 * This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}.
 * See also {@link http://sourceforge.net/projects/evocms/}.
 *
 * @copyright (c)2003-2005 by Francois PLANQUE - {@link http://fplanque.net/}.
 * Parts of this file are copyright (c)2004-2005 by Daniel HAHLER - {@link http://thequod.de/contact}.
 * Parts of this file are copyright (c)2005 by Halton STEWART - {@link http://hstewart.net/}.
 * @license http://b2evolution.net/about/license.html GNU General Public License (GPL)
 * {@internal
 * b2evolution is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License,  or
 * (at your option) any later version.
 *
 * b2evolution is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with b2evolution; if not,  write to the Free Software
 * Foundation,  Inc.,  59 Temple Place,  Suite 330,  Boston,  MA  02111-1307  USA
 * }}
 *
 * {@internal
 * Halton STEWART grants François PLANQUE the right to license
 * Halton STEWART's contributions to this file and the b2evolution project
 * under any OSI approved OSS license (http://www.opensource.org/licenses/).
 * Daniel HAHLER grants François PLANQUE the right to license
 * Daniel HAHLER's contributions to this file and the b2evolution project
 * under any OSI approved OSS license (http://www.opensource.org/licenses/).
 * }}
 *
 * @package admin
 *
 * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
 * @author halton: Halton STEWART.
 * @author fplanque: François PLANQUE.
 * @author blueyed: Daniel HAHLER.
 *
 * @version $Id: features.php, v 1.11 2005/11/05 00:05:42 blueyed Exp $
 */

/**
 * Includes:
 */
require( dirname(__FILE__).'/_header.php' );

$AdminUI->set_path'options',  'features' );

param'action',  'string' );

switch( 
$action )
{
    case 
'update':
        
// Check permission:
        
$current_User->check_perm'options',  'edit',  true );

        
param'submit',  'array',  array() );
        if( isset(
$submit['restore_defaults']) )
        {
            
/*
            // TODO: insert some default settings rather than just delete them all,  as per original configuration in the _advanced.php file:
            # mailserver settings
            $mailserver_url = 'mail.example.com';
            $mailserver_login = 'login <at> example <dot> com';
            $mailserver_pass = 'password';
            $mailserver_port = 110;
            # by default posts will have this category
            $default_category = 1;
            # subject prefix
            $subjectprefix = 'blog:';
            # body terminator string (starting from this string,  everything will be ignored,  including this string)
            $bodyterminator = "___";
            # set this to 1 to run in test mode
            $thisisforfunonly = 0;
            ### Special Configuration for some phone email services
            # some mobile phone email services will send identical subject & content on the same line
            # if you use such a service,  set $use_phoneemail to 1,  and indicate a separator string
            # when you compose your message,  you'll type your subject then the separator string
            # then you type your login:password,  then the separator,  then content
            $use_phoneemail = 0;
            $phoneemail_separator = ':::';
            */

            
$Settings->delete_array( array(
                
'eblog_enabled',  'eblog_method',  'eblog_server_host',  'eblog_server_port',  'eblog_username',  'eblog_password',  'eblog_default_category',  'eblog_subject_prefix',
                
'hit_doublecheck_referer',  'auto_prune_stats',
                
'timeout_sessions',
                
'webhelp_enabled' ) );

            if( 
$Settings->dbupdate() )
            {
                
$Messages->addT_('Restored default values.'),  'success' );
            }
            else
            {
                
$Messages->addT_('Settings have not changed.'),  'note' );
            }
        }
        else
        {
            
// Online help
            
$Request->param'webhelp_enabled',  'integer',  );
            
$Settings->set'webhelp_enabled',  $webhelp_enabled );


            
// Blog by email
            
$Request->param'eblog_enabled',  'integer',  );
            
$Settings->set'eblog_enabled',  $eblog_enabled );

            
$Request->param'eblog_method',  'string',  true );
            
$Settings->set'eblog_method',  strtolower(trim($eblog_method)));

            
$Request->param'eblog_server_host',  'string',  true );
            
$Settings->set'eblog_server_host',  strtolower(trim($eblog_server_host)));

            
$Request->param'eblog_server_port',  'integer',  );
            
$Settings->set'eblog_server_port',  $eblog_server_port );

            
$Request->param'eblog_username',  'string',  true );
            
$Settings->set'eblog_username',  trim($eblog_username));

            
$Request->param'eblog_password',  'string',  true );
            
$Settings->set'eblog_password',  trim($eblog_password));

            
$Request->param'eblog_default_category',  'integer',  );
            
$Settings->set'eblog_default_category',  $eblog_default_category );

            
$Request->param'eblog_subject_prefix',  'string',  true );
            
$Settings->set'eblog_subject_prefix',  trim($eblog_subject_prefix) );

            
$Request->param'eblog_body_terminator',  'string',  true );
            
$Settings->set'eblog_body_terminator',  trim($eblog_body_terminator) );

            
$Request->param'eblog_test_mode',  'integer',  );
            
$Settings->set'eblog_test_mode',  $eblog_test_mode );

            
$Request->param'eblog_phonemail',  'integer',  );
            
$Settings->set'eblog_phonemail',  $eblog_phonemail );

            
$Request->param'eblog_phonemail_separator',  'string',  true );
            
$Settings->set'eblog_phonemail_separator',  trim($eblog_phonemail_separator) );


            
// Statistics
            
$Request->param'hit_doublecheck_referer',  'integer',  );
            
$Settings->set'hit_doublecheck_referer',  $hit_doublecheck_referer );

            
$Request->param'auto_prune_stats',  'integer',  $Settings->get_default('auto_prune_stats') );
            
$Settings->set'auto_prune_stats',  $Request->get('auto_prune_stats') );


            
// Sessions
            
$timeout_sessions $Request->param'timeout_sessions',  'integer',  $Settings->get_default('timeout_sessions') );
            if( 
$timeout_sessions 3600 )
            { 
// lower than 1 hour: not allowed
                
$timeout_sessions 3600;
                
$Messages->addsprintfT_'You cannot set a session timeout below %d seconds.' ),  3600 ),  'error' );
            }
            elseif( 
$timeout_sessions 86400 )
            { 
// lower than 1 day: notice/warning
                
$Messages->addsprintfT_'Warning: your session timeout is just %d seconds. Your users may have to re-login often!' ),  $timeout_sessions ),  'note' );
            }
            
$Settings->set'timeout_sessions',  $timeout_sessions );


            if( ! 
$Messages->count('error') )
            {
                if( 
$Settings->dbupdate() )
                {
                    
$Messages->addT_('Settings updated.'),  'success' );
                }
                else
                {
                    
$Messages->addT_('Settings have not changed.'),  'note' );
                }
            }
        }
        break;
}


/**
 * Display page header:
 */
require dirname(__FILE__).'/_menutop.php';

// Check permission to view:
$current_User->check_perm'options',  'view',  true );

// Begin payload block:
$AdminUI->disp_payload_begin();

require 
dirname(__FILE__).'/_set_features.form.php';

// End payload block:
$AdminUI->disp_payload_end();

require 
dirname(__FILE__).'/_footer.php';
?>


Other Blog Scripts:

WebMaster Resources Home

©RingsWorld.com