Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift_FailoverTransport
  • Swift_LoadBalancedTransport
  • Swift_MailTransport
  • Swift_Plugins_Loggers_ArrayLogger
  • Swift_Plugins_Loggers_EchoLogger
  • Swift_SendmailTransport
  • Swift_SmtpTransport
  • Swift_Transport_AbstractSmtpTransport
  • Swift_Transport_Esmtp_Auth_CramMd5Authenticator
  • Swift_Transport_Esmtp_Auth_LoginAuthenticator
  • Swift_Transport_Esmtp_Auth_PlainAuthenticator
  • Swift_Transport_Esmtp_AuthHandler
  • Swift_Transport_EsmtpTransport
  • Swift_Transport_FailoverTransport
  • Swift_Transport_LoadBalancedTransport
  • Swift_Transport_MailTransport
  • Swift_Transport_SendmailTransport
  • Swift_Transport_SimpleMailInvoker
  • Swift_Transport_StreamBuffer

Interfaces

  • Swift_Plugins_Logger
  • Swift_Plugins_Pop_Pop3Exception
  • Swift_Transport
  • Swift_Transport_Esmtp_Authenticator
  • Swift_Transport_EsmtpHandler
  • Swift_Transport_IoBuffer
  • Swift_Transport_MailInvoker
  • Swift_Transport_SmtpAgent
  • Swift_TransportException
  • Overview
  • Package
  • Function
  • Todo
  • Download
  1: <?php
  2: /**
  3:  * AMR Content expert controller class
  4:  *
  5:  * @package     Plugin
  6:  * @subpackage  ModRewrite
  7:  * @version     SVN Revision $Rev:$
  8:  * @id          $Id$:
  9:  * @author      Murat Purc <murat@purc.de>
 10:  * @copyright   four for business AG <www.4fb.de>
 11:  * @license     http://www.contenido.org/license/LIZENZ.txt
 12:  * @link        http://www.4fb.de
 13:  * @link        http://www.contenido.org
 14:  */
 15: 
 16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 17: 
 18: 
 19: /**
 20:  * Content expert controller for expert settings/actions.
 21:  *
 22:  * @author      Murat Purc <murat@purc.de>
 23:  * @package     Plugin
 24:  * @subpackage  ModRewrite
 25:  */
 26: class ModRewrite_ContentExpertController extends ModRewrite_ControllerAbstract {
 27: 
 28:     /**
 29:      * Path to restrictive htaccess file
 30:      * @var string
 31:      */
 32:     protected $_htaccessRestrictive = '';
 33: 
 34:     /**
 35:      * Path to simple htaccess file
 36:      * @var string
 37:      */
 38:     protected $_htaccessSimple = '';
 39: 
 40:     /**
 41:      * Initializer method, sets the paths to htaccess files
 42:      */
 43:     public function init() {
 44:         $this->_oView->content_before = '';
 45: 
 46:         $pluginPath = $this->_cfg['path']['contenido'] . $this->_cfg['path']['plugins'] . 'mod_rewrite/';
 47:         $this->_htaccessRestrictive = $pluginPath . 'files/htaccess_restrictive.txt';
 48:         $this->_htaccessSimple = $pluginPath . 'files/htaccess_simple.txt';
 49:     }
 50: 
 51:     /**
 52:      * Index action
 53:      */
 54:     public function indexAction() {
 55: 
 56:     }
 57: 
 58:     /**
 59:      * Copy htaccess action
 60:      */
 61:     public function copyHtaccessAction() {
 62:         $type = $this->_getParam('htaccesstype');
 63:         $copy = $this->_getParam('copy');
 64: 
 65:         if ($type != 'restrictive' && $type != 'simple') {
 66:             return;
 67:         } elseif ($copy != 'contenido' && $copy != 'cms') {
 68:             return;
 69:         }
 70: 
 71:         $aInfo = $this->getProperty('htaccessInfo');
 72: 
 73:         if ($aInfo['has_htaccess']) {
 74:             $this->_oView->content_before = $this->_notifyBox('warning', i18n('.htaccess already exists at CONTENIDO-/or client directory, so it is not copied.', 'mod_rewrite'));
 75:             return;
 76:         }
 77: 
 78:         if ($type == 'restrictive') {
 79:             $source = $this->_htaccessRestrictive;
 80:         } else {
 81:             $source = $this->_htaccessSimple;
 82:         }
 83: 
 84:         if ($copy == 'contenido') {
 85:             $dest = $aInfo['contenido_full_path'] . '.htaccess';
 86:         } else {
 87:             $dest = $aInfo['client_full_path'] . '.htaccess';
 88:         }
 89: 
 90:         if (!$result = @copy($source, $dest)) {
 91:             $this->_oView->content_before = $this->_notifyBox('warning', sprintf(i18n('.htaccess could not copy from <strong>%s</strong> to <strong>%s</strong>! Perhaps the target directory has not the required rights to write files at your webserver.', 'mod_rewrite'), $source, $dest));
 92:             return;
 93:         }
 94: 
 95:         $msg = sprintf(i18n('.htaccess are successfully copied to %s', 'mod_rewrite'), str_replace('.htaccess', '', $dest));
 96:         $this->_oView->content_before = $this->_notifyBox('info', $msg);
 97:     }
 98: 
 99:     /**
100:      * Download htaccess action
101:      */
102:     public function downloadHtaccessAction() {
103:         $type = $this->_getParam('htaccesstype');
104: 
105:         if ($type != 'restrictive' && $type != 'simple') {
106:             return;
107:         }
108: 
109:         if ($type == 'restrictive') {
110:             $source = $this->_htaccessRestrictive;
111:         } else {
112:             $source = $this->_htaccessSimple;
113:         }
114: 
115:         $this->_oView->content = cFileHandler::read($source);
116: 
117:         header('Content-Type: text/plain');
118:         header('Etag: ' . md5(mt_rand()));
119:         header('Content-Disposition: attachment; filename="' . $type . '.htaccess"');
120:         $this->render('{CONTENT}');
121:     }
122: 
123:     /**
124:      * Reset aliases action
125:      */
126:     public function resetAction() {
127:         // recreate all aliases
128:         ModRewrite::recreateAliases(false);
129:         $this->_oView->content_before = $this->_notifyBox('info', i18n('All aliases have been reset.', 'mod_rewrite'));
130:     }
131: 
132:     /**
133:      * Reset only empty aliases action
134:      */
135:     public function resetEmptyAction() {
136:         // recreate only empty aliases
137:         ModRewrite::recreateAliases(true);
138:         $this->_oView->content_before = $this->_notifyBox('info', i18n('Only empty aliases have been reset.', 'mod_rewrite'));
139:     }
140: 
141: }
142: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen