Example #1
0
    ?>
    <?php 
}
?>
    <form accept-charset="<?php 
echo \thebuggenie\core\framework\Context::getI18n()->getCharset();
?>
" action="<?php 
echo make_url('login');
?>
" method="post" id="login_form" onsubmit="TBG.Main.Login.login('<?php 
echo make_url('login');
?>
'); return false;">
        <?php 
if (!\thebuggenie\core\framework\Context::hasMessage('login_force_redirect') || \thebuggenie\core\framework\Context::getMessage('login_force_redirect') !== true) {
    ?>
            <input type="hidden" id="tbg3_referer" name="tbg3_referer" value="<?php 
    echo $referer;
    ?>
" />
        <?php 
} else {
    ?>
            <input type="hidden" id="return_to" name="return_to" value="<?php 
    echo $referer;
    ?>
" />
        <?php 
}
?>
Example #2
0
        <div id="backdrop_detail_content" class="backdrop_detail_content rounded_top login_content">
            <?php 
include_component('main/login', compact('section', 'error'));
?>
        </div>
    </div>
</div>
<script type="text/javascript">
    require(['domReady', 'thebuggenie/tbg', 'jquery'], function (domReady, TBG, jquery) {
        domReady(function () {
        <?php 
if (\thebuggenie\core\framework\Context::hasMessage('login_message')) {
    ?>
            TBG.Main.Helpers.Message.success('<?php 
    echo \thebuggenie\core\framework\Context::getMessageAndClear('login_message');
    ?>
');
        <?php 
} elseif (\thebuggenie\core\framework\Context::hasMessage('login_message_err')) {
    ?>
            TBG.Main.Helpers.Message.error('<?php 
    echo \thebuggenie\core\framework\Context::getMessageAndClear('login_message_err');
    ?>
');
        <?php 
}
?>
            jquery('#tbg3_username').focus();
        });
    });
</script>
Example #3
0
 /**
  * Configure a module
  *
  * @param framework\Request $request The request object
  */
 public function runConfigureModule(framework\Request $request)
 {
     $this->forward403unless($this->access_level == framework\Settings::ACCESS_FULL);
     try {
         $module = framework\Context::getModule($request['config_module']);
         if (!$module->isEnabled()) {
             throw new \Exception('disabled');
         } elseif (!$module->hasConfigSettings()) {
             throw new \Exception('module not configurable');
         } else {
             if ($request->isPost() && $this->access_level == framework\Settings::ACCESS_FULL) {
                 try {
                     $module->postConfigSettings($request);
                     if (!framework\Context::hasMessage('module_message')) {
                         framework\Context::setMessage('module_message', framework\Context::getI18n()->__('Settings saved successfully'));
                     }
                 } catch (\Exception $e) {
                     framework\Context::setMessage('module_error', $e->getMessage());
                 }
                 $this->forward(framework\Context::getRouting()->generate('configure_module', array('config_module' => $request['config_module'])));
             }
             $this->module = $module;
         }
     } catch (\Exception $e) {
         framework\Logging::log('Trying to configure module ' . $request['config_module'] . " which isn't configurable", 'main', framework\Logging::LEVEL_FATAL);
         framework\Context::setMessage('module_error', framework\Context::getI18n()->__('The module "%module_name" is not configurable', array('%module_name' => $request['config_module'])));
         $this->forward(framework\Context::getRouting()->generate('configure_modules'));
     }
     $this->module_message = framework\Context::getMessageAndClear('module_message');
     $this->module_error = framework\Context::getMessageAndClear('module_error');
     $this->module_error_details = framework\Context::getMessageAndClear('module_error_details');
 }
Example #4
0
 public function componentLogin()
 {
     $this->selected_tab = isset($this->section) ? $this->section : 'login';
     $this->options = $this->getParameterHolder();
     if (framework\Context::hasMessage('login_referer')) {
         $this->referer = htmlentities(framework\Context::getMessage('login_referer'), ENT_COMPAT, framework\Context::getI18n()->getCharset());
     } elseif (array_key_exists('HTTP_REFERER', $_SERVER)) {
         $this->referer = htmlentities($_SERVER['HTTP_REFERER'], ENT_COMPAT, framework\Context::getI18n()->getCharset());
     } else {
         $this->referer = framework\Context::getRouting()->generate('dashboard');
     }
     try {
         $this->loginintro = null;
         $this->registrationintro = null;
         $this->loginintro = \thebuggenie\modules\publish\entities\tables\Articles::getTable()->getArticleByName('LoginIntro');
         $this->registrationintro = \thebuggenie\modules\publish\entities\tables\Articles::getTable()->getArticleByName('RegistrationIntro');
     } catch (\Exception $e) {
     }
     if (framework\Settings::isLoginRequired()) {
         framework\Context::getResponse()->deleteCookie('tbg3_username');
         framework\Context::getResponse()->deleteCookie('tbg3_password');
         $this->error = framework\Context::geti18n()->__('You need to log in to access this site');
     } elseif (!framework\Context::getUser()->isAuthenticated()) {
         $this->error = framework\Context::geti18n()->__('Please log in');
     } else {
         //$this->error = framework\Context::geti18n()->__('Please log in');
     }
 }
Example #5
0
 public function listenViewIssuePostError(\thebuggenie\core\framework\Event $event)
 {
     if (framework\Context::hasMessage('comment_error')) {
         $this->comment_error = true;
         $this->error = framework\Context::getMessageAndClear('comment_error');
         $this->comment_error_body = framework\Context::getMessageAndClear('comment_error_body');
     }
 }