예제 #1
0
 public static function registerUser()
 {
     $sql = sql::factory();
     $sql->setTable('community_user');
     $sql->getPosts(['username' => 'string', 'password' => 'string', 'email' => 'string']);
     $validator = new validator();
     $email = $sql->getPost('email');
     $username = $sql->getPost('username');
     $password = $sql->getPost('password');
     $validUsername = $validator->costum($username, function () {
         preg_match('/\\w{4,}/', $username, $match);
         return $match[0] == $username;
     });
     if (!$validUsername) {
         return 'Username darf nur aus Buchstaben Zahlen und Unterstrich bestehen und muss mindestens 4 Zeichen lang sein.';
     }
     if ($sql->num('SELECT id FROM ' . sql::table('community_user') . ' WHERE `username`= "' . $sql->escape($username) . '"')) {
         return 'Benutzername schon vorhanden';
     }
     if (!$validator->email($email)) {
         return 'Bitte geben Sie eine E-Mail Adresse an';
     }
     $salt = userLogin::generateSalt();
     $sql->addDatePost('registerdate', 'now');
     $sql->addPost('salt', $salt);
     extension::get('COMMUNITY_USER_REGISTER', $sql);
     $password = userLogin::hash($password, $salt);
     $sql->addPost('password', $password);
     $sql->save();
     //Mail send
     return true;
 }
예제 #2
0
파일: page.php 프로젝트: pasternt/dynaoCMS
 public function getTemplate()
 {
     ob_start();
     $content = self::generateArticle($this->get('id'));
     $content = extension::get('FRONTEND_OUTPUT', $content);
     dyn::add('content', $content);
     include dir::template(dyn::get('template'), $this->get('template'));
     $content = ob_get_contents();
     ob_end_clean();
     return $content;
 }
예제 #3
0
 public static function factory()
 {
     $class = get_called_class();
     $args = [];
     if (extension::has($class . '_CLASS')) {
         $class = extension::get($class . '_CLASS');
     }
     if (func_num_args()) {
         $args = func_get_args();
     }
     $reflect = new ReflectionClass($class);
     return $reflect->newInstanceArgs($args);
 }
예제 #4
0
파일: url.php 프로젝트: pasterntt/dynao-CMS
 public static function fe($id = '', $params = [])
 {
     if ($id == '') {
         type::super('page_id', 'int', dyn::get('start_page'));
     }
     $url = extension::get('URL_REWRITE', ['id' => $id, 'params' => $params]);
     if (!extension::has('URL_REWRITE')) {
         $url = 'index.php?page_id=' . $id;
         foreach ($params as $name => $value) {
             $url .= '&' . $name . '=' . $value;
         }
     }
     return $url;
 }
예제 #5
0
 public function getTemplate()
 {
     ob_start();
     if (!pageCache::exist($this->get('id'))) {
         pageCache::generateArticle($this->get('id'));
     }
     $content = pageCache::read($this->get('id'));
     $content = pageArea::getEval($content);
     $content = extension::get('FRONTEND_OUTPUT', $content);
     dyn::add('content', $content);
     include dir::template(dyn::get('template'), $this->get('template'));
     $content = ob_get_contents();
     ob_end_clean();
     return $content;
 }
예제 #6
0
 public static function checkLogin()
 {
     $username = type::post('username', 'string', '');
     $password = type::post('password', 'string', '');
     if ($username == '' || $password == '') {
         echo message::info(lang::get('login_form_notfull'), true);
         return;
     }
     $sql = sql::factory();
     $sql->query('SELECT password, salt, id FROM ' . sql::table('community_user') . ' WHERE `username` = "' . $sql->escape($username) . '"');
     if (!$sql->num()) {
         echo message::danger(sprintf(lang::get('login_no_user'), $email), true);
         return;
     }
     $sql->result();
     if (!userLogin::checkPassword($password, $sql->get('salt'), $sql->get('password'))) {
         echo message::danger(lang::get('login_pwd_false'), true);
         return;
     }
     $_SESSION['community-login'] = $sql->get('id');
     self::checkSession();
     // Für spätere Foren-Bridges
     extension::get('COMMUNITY_USER_LOGIN', $password);
 }
예제 #7
0
            ' . lang::get('idea_text') . '
            <hr />
        </div>
        <div class="col-md-9">
           <textarea class="form-control"></textarea>
        </div>
        <div class="col-md-3">
           <p><button class="btn btn-default">' . lang::get('send') . '</button></p>
            <div id="ajax-content"></div>
        </div>
    </div>
    ', ['id' => 'idea', 'col' => 'lg-6']);
?>
    </div>
    <div class="expand">
    	<i class="fa fa-chevron-up"></i>
    </div>
</section>
		
<div class="row">
    <?php 
$button = '<a href="http://dynao.de" target="_blank" class="btn btn-sm btn-default">' . lang::get('all_addons') . '</a>';
echo bootstrap::panel(lang::get('addons'), [$button], dyn::getAddons(), ['table' => true, 'col' => 'lg-6']);
$button = '<a href="http://dynao.de" target="_blank" class="btn btn-sm btn-default">' . lang::get('all_modules') . '</a>';
echo bootstrap::panel(lang::get('modules'), [$button], dyn::getModules(), ['table' => true, 'col' => 'lg-6']);
?>
</div>

<?php 
echo extension::get('DASHBOARD_OVERVIEW', '');
예제 #8
0
 public static function generatePathlist()
 {
     $return = [];
     $sql = sql::factory();
     $sql->query('SELECT name, id, seo_costum_url, parent_id FROM ' . sql::table('structure'))->result();
     while ($sql->isNext()) {
         if ($sql->get('seo_costum_url')) {
             $name = $sql->get('seo_costum_url');
         } else {
             $name = self::makeSEOName($sql->get('name'));
         }
         if ($sql->get('parent_id')) {
             $name = self::getParentsName($sql->get('parent_id')) . '/' . $name;
         }
         if ($sql->get('id') == dyn::get('start_page') && dyn::get('addons')['seo']['start_url'] == 0) {
             $name = '';
         }
         $return[$name] = (int) $sql->get('id');
         $sql->next();
     }
     $return = extension::get('SEO_GENERATE_PATHLIST', $return);
     return file_put_contents(dir::addon('seo', 'pathlist.json'), json_encode($return, JSON_PRETTY_PRINT));
 }
예제 #9
0
파일: index.php 프로젝트: kyroskoh/rokket
if (!is_null($error)) {
    echo message::danger($error);
} elseif (!is_null($success)) {
    echo message::success($success);
}
layout::addNav(lang::get('dashboard'), 'dashboard', 'home', ['refresh'], true);
layout::addNav(lang::get('settings'), 'settings', 'settings', [], false);
layout::addNav(lang::get('server'), 'server', 'list', ['add'], true);
layout::addNav(lang::get('addons'), 'addons', 'alt', [], true);
layout::addNav(lang::get('user'), 'user', 'users', ['add'], true);
foreach (addonConfig::includeAllConfig() as $file) {
    include $file;
}
if (userLogin::isLogged()) {
    $path = 'pages/' . $page . '.php';
    $path = extension::get('PAGE_PATH', $path);
    if (file_exists($path)) {
        include $path;
    } else {
        echo message::danger(lang::get('page_not_found'), false);
    }
}
$content = ob_get_contents();
ob_end_clean();
rp::add('content', $content);
if (ajax::is()) {
    echo ajax::getReturn();
    die;
}
if (userLogin::isLogged()) {
    include dir::layout('index.php', rp::get('layout'));
예제 #10
0
$subpage = type::super('subpage', 'string');
$successMsg = type::get('success_msg', 'string');
$errorMsg = type::get('error_msg', 'string');
if (!is_null($errorMsg)) {
    echo message::danger($errorMsg);
} elseif (!is_null($successMsg)) {
    echo message::success($successMsg);
}
if (userLogin::isLogged()) {
    if ($file = backend::getNaviInclude()) {
        include $file;
    }
}
$content = ob_get_contents();
ob_end_clean();
$content = extension::get('BACKEND_OUTPUT', $content);
dyn::add('content', $content);
if (ajax::is()) {
    $deleteAction = type::get('deleteAction', 'bool', false);
    if ($deleteAction) {
        $title = type::get('title', 'string');
        $message = type::get('message', 'string');
        getDeleteModal($title, $message);
    }
    echo ajax::getReturn();
    die;
}
if (userLogin::isLogged()) {
    include dir::backend('layout/index.php');
} else {
    include dir::backend('layout/login.php');
예제 #11
0
<?php

if ($action == 'deleteCache') {
    cache::clear();
    pageCache::clearAll();
    extension::get('SETTINGS_DELETE_CACHE');
    echo message::success(lang::get('delete_cache_success'), true);
}
if ($action == 'loadTemplate') {
    $template = new template(dyn::get('template'));
    if ($template->install(true) !== true) {
        echo message::danger(lang::get('load_template_failed'), true);
    } else {
        echo message::success(lang::get('load_template_success'), true);
    }
}
?>
<div class="row">	
    <div class="col-lg-8">
        <div class="panel panel-default">
            <div class="panel-heading">
            	<h3 class="panel-title pull-left"><?php 
echo lang::get('general');
?>
</h3>
                <div class="pull-right">
                	<a href="<?php 
echo url::backend('settings', ['subpage' => 'main', 'action' => 'deleteCache']);
?>
" class="btn btn-sm btn-default"><?php 
echo lang::get('delete_cache');
예제 #12
0
 /**
  * Fügt das Formular zusammen und speichert es, falls nötig
  *
  * @return	string
  *
  */
 public function show()
 {
     extension::get('FORM_BEFORE_ACTION', $this);
     foreach ($this->getParams() as $key => $value) {
         $param = $this->addHiddenField($key, $value);
         $param->setSave(false);
     }
     if ($this->isSubmit(true)) {
         $this->saveForm();
         if (!$this->isSaveEdit() && is_null($this->errorMessage)) {
             $this->redirect();
         }
         if (!is_null($this->errorMessage)) {
             echo message::danger($this->errorMessage);
         } elseif (!is_null($this->successMessage)) {
             echo message::success($this->successMessage);
         }
     }
     $return = [];
     $buttons = [];
     $hidden = [];
     $x = 1;
     $return[] = '<form' . html_convertAttribute($this->formAttributes) . '>' . PHP_EOL;
     foreach ($this->return as $ausgabe) {
         if ($ausgabe->getAttribute('type') == 'hidden') {
             $hidden[] = $ausgabe->get();
             continue;
         }
         if (!$ausgabe->hasAttribute('id')) {
             $ausgabe->addAttribute('id', 'form_' . $x);
         }
         $return[] = '<div class="form-group">';
         $return[] = '<label for="' . $ausgabe->getAttribute('id') . '">' . $ausgabe->fieldName . '</label>';
         $return[] = '<div class="form-wrap-input">' . $ausgabe->prefix . $ausgabe->get() . $ausgabe->suffix . '</div>';
         $return[] = '</div>';
         $x++;
     }
     foreach ($this->buttons as $button) {
         $buttons[] = $button->get();
     }
     $return[] = implode(PHP_EOL, $hidden);
     $return[] = '<div class="form-group">';
     $return[] = '<div class="form-submit-area col-sm-10 btn-group">' . implode(PHP_EOL, $buttons) . '</div>';
     $return[] = '</div>';
     $return[] = '</form>';
     $return = extension::get('FORM_BEFORE_SHOW', implode(PHP_EOL, $return));
     return $return;
 }
예제 #13
0
<?php

ob_end_clean();
foreach (addonConfig::includeAllConfig() as $file) {
    if (file_exists($file)) {
        require_once $file;
    }
}
$page = type::super('page_id', 'int', dyn::get('start_page'));
$page = extension::get('SET_PAGE_ID', $page);
dyn::add('page_id', $page);
if (page::isValid($page)) {
    $page = new page($page);
} else {
    header('HTTP/1.0 404 Not Found');
    $page = new page(dyn::get('error_page'));
}
echo $page->getTemplate();
예제 #14
0
 public function show()
 {
     extension::get('TABLE_BEFORE_ACTION', $this);
     $return = $this->getCaption();
     $return .= $this->getCollsLayout();
     $return .= $this->getSection($this->thead, 'thead');
     $return .= $this->getSection($this->tfoot, 'tfoot');
     $return .= $this->getSection($this->tbody, 'tbody');
     $return = $this->addTag('table', $this->tableAttr, PHP_EOL . $return);
     return extension::get('TABLE_BEFORE_SHOW', $return);
 }