示例#1
0
 function ajax_loadeditor()
 {
     $attachment_types = array();
     h2_execute_event('publish_attachments_register', $attachment_types);
     foreach ($attachment_types as $att) {
         $id = md5($att['editor']);
         if ($_REQUEST['id'] == $id) {
             $editorFile = 'plugins/' . $att['editor'];
             if (file_exists($editorFile)) {
                 include $editorFile;
             } else {
                 print h2_uibanner('Editor not found: ' . $att['caption']);
             }
         }
     }
 }
示例#2
0
 function ajax_do()
 {
     $msg = '';
     $url = '';
     switch ($_REQUEST['method']) {
         case 'openid':
             if (trim($_REQUEST['openid']) == '') {
                 $msg = h2_uibanner(l10n('openid.please'));
             } else {
                 $_SESSION['myopenidurl'] = trim($_REQUEST['openid']);
                 $_SESSION['load_signin'] = 'openid';
                 $msg = l10n('openid.signing.in') . ' ' . $_SESSION['myopenidurl'] . '...';
                 $url = actionUrl('openid', 'signin', array('id' => $_SESSION['myopenidurl']));
             }
             break;
         case 'email':
             $emailAddress = trim(strtolower($_REQUEST['email']));
             $loginPassword = trim($_REQUEST['password']);
             $passwordHash = md5($emailAddress . $loginPassword);
             if ($emailAddress == '' || $loginPassword == '') {
                 $msg = h2_uibanner(l10n('fillout.fields'));
             } else {
                 require_once 'lib/is_email.php';
                 $_SESSION['load_signin'] = 'email';
                 if ($_REQUEST['mode'] == 'new') {
                     $nds = $this->model->getAccount('email', $emailAddress);
                     if ($nds['ia_user'] > 0) {
                         $msg = h2_uibanner(l10n('email.inuse'));
                     } else {
                         if (strlen($loginPassword) < 5) {
                             $msg = h2_uibanner(l10n('email.password.tooshort'));
                         } else {
                             if (is_email($emailAddress, true, E_WARNING) != ISEMAIL_VALID) {
                                 $msg = h2_uibanner(l10n('email.invalid'));
                             } else {
                                 $msg = l10n('email.creating.account') . '...';
                                 $nds['ia_password'] = $passwordHash;
                                 $this->model->newAccount($nds);
                                 $url = $this->getUrlAfterSignin();
                             }
                         }
                     }
                 } else {
                     $ids = $this->model->getAccount('email', $emailAddress);
                     if ($ids['ia_user'] > 0 && $ids['ia_password'] == $passwordHash) {
                         object('user')->loginWithId($ids['ia_user']);
                         $msg = '<img src="themes/default/ajax-loader.gif"/> ' . l10n('email.signing.in') . '...';
                         $url = $this->getUrlAfterSignin();
                     } else {
                         $msg = h2_uibanner(l10n('email.login.fail') . '<br/><a href="' . actionUrl('recover', 'signin') . '">' . l10n('email.recover') . '</a>');
                     }
                 }
             }
             break;
     }
     print json_encode(array('html' => $msg, 'url' => $url));
 }
示例#3
0
<?

$cfgData = getConfigData();

$form = new CQForm('admin_login');
$form

  ->add('html', '<b class="smalltext">'.l10n('login.fb.enable').'</b>')
  ->add('checkbox', 'facebook/enabled')
  ->add('string', 'facebook/app_id')
  ->add('string', 'facebook/api_key')
  ->add('string', 'facebook/app_secret')
  
  ->add('html', '<b class="smalltext">'.l10n('login.twitter.enable').'</b>')
  ->add('checkbox', 'twitter/enabled')
  ->add('string', 'twitter/api_key')
  ->add('string', 'twitter/consumer_key')
  ->add('string', 'twitter/consumer_secret')

  ->add('submit', 'save', l10n('save'))
  ->ds($cfgData)
  ->receive(function($ndata) {
      setConfigData($ndata+getConfigData());
      print(h2_uibanner(l10n('settings.saved'), true));
    })
  ->display();

?>
示例#4
0
<div class="login_pane"><?

if($_SESSION['msg'])
{
  ?><div class="banner fail">
    <?php 
echo htmlspecialchars($_SESSION['msg']);
?>
  </div><?
  unset($_SESSION['msg']);
}
$GLOBALS['page.h1'] = l10n('hubbub.server');
?>
<? if($_REQUEST['msg'] != '') print(h2_uibanner(htmlspecialchars($_REQUEST['msg']))); ?>
<table width="900" align="center">
  <tr>
    <td>
    
    <h2><?php 
echo $this->srvName;
?>
 <?php 
echo l10n('hubbub.server');
?>
</h2>
    
    <div id="bubble_items">
    
      <div class="paragraph padded_extra" style="width: 500px">      
        <a href="http://hubbub.at">Hubbub</a> <?php 
echo l10n('hubbub.is');