コード例 #1
0
ファイル: HashPassword.php プロジェクト: ssrsfs/blg
 public function update($record)
 {
     if ($record['password']) {
         /*$salt = Bam_Functions::RandomId();
         		$type = 'sha1';
         		$hash = sha1("{$record['password']}{$salt}");
         		$record['passhash'] = $hash;
         		$record['salt'] = $salt;
         		$record['hashtype'] = $type;*/
         $record['auth'] = 'Hash';
         $record['hashtype'] = 'bcrypt';
         $prefix = '$2y$';
         $num = str_pad((string) rand(4, 10), 2, '0', STR_PAD_LEFT) . '$';
         $chars = Bam_Functions::RandomId(22);
         $record['salt'] = "{$prefix}{$num}{$chars}";
         $record['passhash'] = crypt($record['password'], $record['salt']);
     }
 }
コード例 #2
0
ファイル: update.inc.php プロジェクト: ssrsfs/blg
<?php

$article->setArray($_POST, false);
if (!empty($_POST['autosummary'])) {
    $article['autosummary'] = 1;
    $xml = Pagemill_SimpleXmlElement::LoadString($_POST['article']);
    if ($xml->p) {
        $summary = trim($xml->p[0]->innerXml());
    } else {
        $summary = trim(Bam_Functions::GetIntro($_POST['article']));
    }
    $article['summary'] = $summary;
} else {
    $article['autosummary'] = 0;
}
$article['image'] = basename(FileManager::GetPostedOrUploadedFile('image', TYPEF_DIR . '/files/public/news', 'jpg,jpeg,png,gif'));
if (FileManager::Error()) {
    $pm->addLoop('errors', array('message' => FileManager::Error()));
} else {
    $article->save();
}
コード例 #3
0
ファイル: JsonDecode.php プロジェクト: ssrsfs/blg
 /**
  * Decode field data from JSON format.
  * @param string|array $field The fields to encode.
  */
 public function __construct($fields)
 {
     $this->_fields = Bam_Functions::ListToArray($fields);
 }