Esempio n. 1
0
 /**
  * Renders the content as a string or an object.
  *
  * Exceptions thrown during the rendering are caught. The message of the exception is used
  * as rendered content and the exception is rethrown.
  *
  * @throws Exception
  *
  * @return string|object The rendered content.
  */
 public function render()
 {
     if ($this->rendered !== null) {
         return $this->rendered;
     }
     $editor = \ICanBoogie\Core::get()->editors[$this->editor];
     return $this->rendered = $editor->render($editor->unserialize($this->content));
 }
Esempio n. 2
0
 /**
  * Renders the body using the associated editor.
  *
  * @return string
  */
 protected function render_body()
 {
     $body = $this->body;
     if (!$this->editor) {
         return $body;
     }
     $editor = \ICanBoogie\Core::get()->editors[$this->editor];
     return (string) $editor->render($editor->unserialize($body));
 }
Esempio n. 3
0
 /**
  * Returns a _Form_ active record.
  *
  * @return Icybee\Modules\Forms\Form
  *
  * @see Icybee\Modules\Editor.Editor::render()
  */
 public function render($content)
 {
     return $content ? Core::get()->models['forms'][$content] : null;
 }
Esempio n. 4
0
 /**
  * Compares a password to the user's password hash.
  *
  * @param string $password
  *
  * @return bool `true` if the hashed password matches the user's password hash,
  * `false` otherwise.
  */
 public function verify_password($password)
 {
     if (\password_verify($password, $this->password_hash)) {
         return true;
     }
     #
     # Trying old hashing
     #
     $config = \ICanBoogie\Core::get()->configs['user'];
     if (empty($config['password_salt'])) {
         return false;
     }
     return sha1(\ICanBoogie\pbkdf2($password, $config['password_salt'])) == $this->password_hash;
 }