コード例 #1
0
ファイル: settings.login.php プロジェクト: hcopr/Hubbub
<?

$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();

?>
コード例 #2
0
ファイル: step1.php プロジェクト: hcopr/Hubbub
<h3>Install Hubbub - Step 1</h3>
<div>
  <b><?php 
echo l10n('db.install');
?>
</b>
</div>
<br/>
<?

$defaultDBServer = 'localhost';
if(isset($_SERVER['DATABASE_SERVER'])) $defaultDBServer = $_SERVER['DATABASE_SERVER'];

include_once('lib/cq-forms.php');
$form = new CQForm('dbcred');

$onChange = 'checkDBFields();';
$form
  ->add('string', 'host', array('default' => $defaultDBServer, 'placeholder' => 'enter DB server name', 'onchange' => $onChange))
  ->add('string', 'user', array('default' => '', 'placeholder' => 'enter DB user name', 'onchange' => $onChange))
  ->add('string', 'password', array('default' => '', 'placeholder' => 'enter DB password', 'onchange' => $onChange))
  ->add('string', 'database', array('default' => 'hubbub2', 'placeholder' => 'enter name of database', 'onchange' => $onChange))
  ->add('button', 'btn.check', array('onclick' => $onChange))
  ->display();

?>
<br/>
<div id="db_check" class="result_box" style="margin-left: 150px;">
  
</div>
<script>
コード例 #3
0
ファイル: signin.recover.php プロジェクト: hcopr/Hubbub
 <a href="./"><?php 
echo $this->srvName;
?>
</a></h2>
    
    <br/>
    <div class="balloon">
      <?php 
echo l10n('email.recovery.balloon');
?>
    </div>
    <br/>
    
    <?
    
    $form = new CQForm('pwrecovery', array('auto-focus' => true));
    $form
      ->add('string', 'email_address', array('validate' => 'email', 'onvalidate' => function($data, $e, $form) { 
          $form->ads = DB_GetDataset('idaccounts', trim($data), 'ia_url');
          if($form->ads['ia_user'] > 0) 
            return(true); else return(l10n('email.notindb')); 
        }))
      ->add('submit', 'email_recover_instructions')
      ->ds($_REQUEST)
      ->receive(function($data, $form) {
          $form->hidden = true;
          send_mail($form->ads['ia_url'], 'email.recovery.php', $form->ads);
          print('<div class="banner">'.l10n('email.recovery.sent').'</div>');
        })
      ->display();
        
コード例 #4
0
ファイル: signin.reset.php プロジェクト: hcopr/Hubbub
echo $this->srvName;
?>
</a></h2>
    
    <br/>
    <div class="balloon">
      <b>Welcome, <?php 
echo getDefault($this->usr['u_name'], $this->uds['ia_url']);
?>
</b>
    </div>
    <br/>
    
    <?
    
    $form = new CQForm('pwrecovery', array('auto-focus' => true));
    $form
      ->add('password', 'new_pwd', array('onvalidate' => function($value, $e, $form) { 
          $form->pwd = trim($value);
          if(strlen($form->pwd) < 5) return(l10n('email.password.tooshort')); else return(true);
        }))
      ->add('param', 'i', $_REQUEST['i'])
      ->add('submit', 'reset_pwd')
      ->ds($_REQUEST)
      ->receive(function($data, $form) {
          $uds = DB_GetDataset('idaccounts', $_REQUEST['i'], 'ia_recovery');
          $uds['ia_password'] = md5($uds['ia_url'].$form->pwd);
          $uds['ia_recovery'] = '';
          DB_UpdateDataset('idaccounts', $uds);
          object('user')->loginWithId($uds['ia_user']);
          print(l10n('email.password.reset').'<br/><br/><a href="'.actionUrl('index', 'home').'" class="btn">&gt; OK</a>');
コード例 #5
0
ファイル: step2.php プロジェクト: hcopr/Hubbub
<h3>Install Hubbub - Step 2</h3>
<div>
  <b>Configuration</b>
</div>
<br/>
<?
$GLOBALS['errorhandler_ignore'] = true;
$_SESSION['install']['ref'] = getDefault($_SERVER['HTTP_REFERER'], $_SESSION['install']['ref']);

include_once('lib/cq-forms.php');

$form = new CQForm('dbcred');

$onChange = 'checkFields();';  

$surl = parse_url($_SERVER['HTTP_REFERER']);
$port = ($surl['port'] == '' || $surl['port'] == 80) ? '' : ':'.$surl['port'];
$sbase = $surl['host'].$port.$surl['path'];
$sbase = getDefault($sbase, $_SESSION['installer']['server_base']);
if(substr($sbase, -1) == '/') $sbase = substr($sbase, 0, -1);

$form
  ->add('string', 'hosturl', array('default' => $sbase, 'onchange' => $onChange, 'infomarker' => '^ This address must be publicly available via HTTP'))
  ->add('string', 'adminpw', array('default' => substr(base64_encode(md5(time())), 0, 8), 'onchange' => $onChange, 'infomarker' => '^ Please make a note of your admin password'))
  ->add('checkbox', 'pingsvc', array('default' => 'Y', 'onchange' => $onChange, 'caption2' => 'Cron Service'))
  ->add('button', 'btn.check', array('onclick' => $onChange))
  ->display();

?>
<br/>
<div id="db_check" class="result_box" style="margin-left: 150px;">