Exemple #1
0
 /**
  * Lädt Sessions-Log (Typ 0)
  */
 private function loadLog0()
 {
     $userList = new \fpcm\model\users\userList();
     $view = new \fpcm\model\view\ajax('sessions', 'logs');
     $view->initAssigns();
     $view->assign('userList', $userList->getUsersAll());
     $view->assign('sessionList', $this->session->getSessions());
     $view->render();
 }
Exemple #2
0
 /**
  * Controller-Processing
  */
 public function process()
 {
     if (!parent::process()) {
         return false;
     }
     $userList = new \fpcm\model\users\userList();
     $this->view->assign('ipList', $this->ipList->getIpAll());
     $this->view->assign('users', $userList->getUsersAll());
     $this->view->render();
 }
 public function runUninstall()
 {
     $userList = new \fpcm\model\users\userList();
     $userId = $userList->getUserIdByUsername('support');
     if (!$userId) {
         return true;
     }
     $user = new \fpcm\model\users\author($userId);
     if ($user->exists()) {
         return $user->delete();
     }
     return true;
 }
Exemple #4
0
 /**
  * Controller-Processing
  */
 public function process()
 {
     if (!parent::process()) {
         return false;
     }
     $userList = new \fpcm\model\users\userList();
     $this->view->assign('userList', $userList->getUsersAll());
     $this->view->assign('sessionList', $this->session->getSessions());
     $this->view->assign('errorLogs', array());
     $this->view->assign('systemLogs', array());
     $this->view->assign('databaseLogs', array());
     $this->view->assign('packagesLogs', array());
     $this->view->assign('customLogs', $this->events->runEvent('logsAddList', array()));
     $this->view->render();
 }
Exemple #5
0
 public function run($params = null)
 {
     $view = new \fpcm\model\view\module('nkorg/rssimport', 'acp', 'main', '');
     $userlist = new \fpcm\model\users\userList();
     $users = $userlist->getUsersNameList();
     $seluser = array_values(array_slice($users, 0, 1));
     $view->assign('userids', $users);
     $view->assign('selectedUser', $seluser[0]);
     $categorylist = new \fpcm\model\categories\categoryList();
     $categories = $categorylist->getCategoriesNameListCurrent();
     $selcategory = array_values(array_slice($categories, 0, 1));
     $view->assign('categoryids', $categories);
     $view->assign('selectedCategory', $selcategory[0]);
     $view->render();
 }
Exemple #6
0
 /**
  * Controller-Processing
  */
 public function process()
 {
     if (!parent::process()) {
         return false;
     }
     $fileList = new \fpcm\model\files\imagelist();
     $page = $this->getRequestVar('page', array(9));
     $list = $fileList->getDatabaseList($this->config->file_list_limit, \fpcm\classes\tools::getPageOffset($page, $this->config->file_list_limit));
     $pagerData = \fpcm\classes\tools::calcPagination($this->config->file_list_limit, $page, $fileList->getDatabaseFileCount(), count($list));
     $list = $this->events->runEvent('reloadFileList', $list);
     $userList = new \fpcm\model\users\userList();
     $this->initViewAssigns($list, $userList->getUsersAll(), $pagerData);
     $this->initPermissions();
     $this->view->initAssigns();
     $this->view->render();
 }
 /**
  * Content rendern
  */
 private function renderContent()
 {
     $ownPermissions = $this->permissions->check(array('article' => 'edit'));
     $allPermissions = $this->permissions->check(array('article' => 'editall'));
     $articleList = new \fpcm\model\articles\articlelist();
     $userlist = new \fpcm\model\users\userList();
     $conditions = array('draft' => -1, 'approval' => -1, 'limit' => array(10, 0), 'orderby' => array('createtime DESC'));
     $articles = $articleList->getArticlesByCondition($conditions);
     $users = array_flip($userlist->getUsersNameList());
     $content = array();
     $content[] = '<table class="fpcm-ui-table fpcm-ui-articles fpcm-ui-large-td">';
     foreach ($articles as $article) {
         $createInfo = $this->language->translate('EDITOR_AUTHOREDIT', array('{{username}}' => isset($users[$article->getCreateuser()]) ? $users[$article->getCreateuser()] : $this->language->translate('GLOBAL_NOTFOUND'), '{{time}}' => date($this->config->system_dtmask, $article->getCreatetime())));
         $content[] = '<tr class="fpcm-small-text">';
         $content[] = '  <td class="fpcm-ui-articlelist-open">';
         $content[] = '  <a class="fpcm-ui-button fpcm-ui-button-blank fpcm-openlink-btn" href="' . $article->getArticleLink() . '" target="_blank" title="' . $this->language->translate('GLOBAL_FRONTEND_OPEN') . '">' . $this->language->translate('GLOBAL_FRONTEND_OPEN') . '</a>';
         if ($article->getEditPermission()) {
             $content[] = '  <a class="fpcm-ui-button fpcm-ui-button-blank fpcm-ui-button-edit fpcm-loader" href="' . $article->getEditLink() . '" title="' . $this->language->translate('GLOBAL_EDIT') . '">' . $this->language->translate('GLOBAL_EDIT') . '</a>';
         } else {
             $content[] = '  <span class="fpcm-ui-button fpcm-ui-button-blank fpcm-ui-button-edit fpcm-ui-readonly" title="' . $this->language->translate('GLOBAL_EDIT') . '">' . $this->language->translate('GLOBAL_EDIT') . '</span>';
         }
         $content[] = '  </td>';
         $content[] = '  <td>';
         $content[] = '  <strong>' . \fpcm\model\view\helper::escapeVal(strip_tags(substr(rtrim($article->getTitle(), '.!?'), 0, 64))) . '...</strong><br>';
         $content[] = '  <span>' . $createInfo . '</span>';
         $content[] = '  </td>';
         $content[] = '  <td class="fpcm-ui-dashboard-recentarticles-meta">';
         if ($article->getPinned()) {
             $content[] = '      <span class="fa-stack fa-fw fpcm-ui-status-1" title="' . $this->language->translate('EDITOR_STATUS_PINNED') . '"><span class="fa fa-square fa-stack-2x"></span><span class="fa fa-thumb-tack fa-rotate-90 fa-stack-1x fa-inverse"></span></span>';
         }
         if ($article->getDraft()) {
             $content[] = '      <span class="fa-stack fa-fw fpcm-ui-status-1" title="' . $this->language->translate('EDITOR_STATUS_DRAFT') . '"><span class="fa fa-square fa-stack-2x"></span><span class="fa fa-file-text-o fa-stack-1x fa-inverse"></span></span>';
         }
         if ($article->getPostponed()) {
             $content[] = '      <span class="fa-stack fa-fw fpcm-ui-status-1" title="' . $this->language->translate('EDITOR_STATUS_POSTPONETO') . '"><span class="fa fa-square fa-stack-2x"></span><span class="fa fa-clock-o fa-stack-1x fa-inverse"></span></span>';
         }
         if ($article->getApproval()) {
             $content[] = '      <span class="fa-stack fa-fw fpcm-ui-status-1" title="' . $this->language->translate('EDITOR_STATUS_APPROVAL') . '"><span class="fa fa-square fa-stack-2x"></span><span class="fa fa-thumbs-o-up fa-stack-1x fa-inverse"></span></span>';
         }
         $content[] = '  </td>';
         $content[] = '</tr>';
     }
     $content[] = '</table>';
     $this->content = implode(PHP_EOL, $content);
     $this->cache->write($this->content, $this->config->system_cache_timeout);
 }
 /**
  * Content rendern
  */
 private function renderContent()
 {
     $ownPermissions = $this->permissions->check(array('article' => 'edit'), array('comment' => 'edit'));
     $allPermissions = $this->permissions->check(array('article' => 'editall'), array('comment' => 'editall'));
     $commenList = new \fpcm\model\comments\commentList();
     $userlist = new \fpcm\model\users\userList();
     $comments = $commenList->getCommentsByLimit(10, 0);
     $users = array_flip($userlist->getUsersNameList());
     $content = array();
     $content[] = '<table class="fpcm-ui-table fpcm-ui-articles fpcm-ui-large-td">';
     foreach ($comments as $comment) {
         $createInfo = $this->language->translate('COMMMENT_LASTCHANGE', array('{{username}}' => isset($users[$comment->getChangeuser()]) ? $users[$comment->getChangeuser()] : $this->language->translate('GLOBAL_NOTFOUND'), '{{time}}' => date($this->config->system_dtmask, $comment->getChangetime())));
         if (!$comment->getChangeuser() && !$comment->getChangetime()) {
             $createInfo = '';
         }
         $content[] = '<tr class="fpcm-small-text">';
         $content[] = '  <td class="fpcm-ui-articlelist-open">';
         $content[] = '  <a class="fpcm-ui-button fpcm-ui-button-blank fpcm-openlink-btn" href="' . $comment->getArticleLink() . '" target="_blank" title="' . $this->language->translate('GLOBAL_FRONTEND_OPEN') . '">' . $this->language->translate('GLOBAL_FRONTEND_OPEN') . '</a>';
         if ($comment->getEditPermission()) {
             $content[] = '  <a class="fpcm-ui-button fpcm-ui-button-blank fpcm-ui-button-edit fpcm-loader" href="' . $comment->getEditLink() . '&amp;mode=1" title="' . $this->language->translate('GLOBAL_EDIT') . '">' . $this->language->translate('GLOBAL_EDIT') . '</a>';
         } else {
             $content[] = '  <span class="fpcm-ui-button fpcm-ui-button-blank fpcm-ui-button-edit fpcm-ui-readonly" title="' . $this->language->translate('GLOBAL_EDIT') . '">' . $this->language->translate('GLOBAL_EDIT') . '</span>';
         }
         $content[] = '  </td>';
         $content[] = '  <td>';
         $content[] = '  <strong>' . \fpcm\model\view\helper::escapeVal(strip_tags($comment->getName())) . '</strong> @ ' . date($this->config->system_dtmask, $comment->getCreatetime()) . '<br>';
         $content[] = '  <span>' . $createInfo . '</span>';
         $content[] = '  </td>';
         $content[] = '  <td class="fpcm-ui-dashboard-recentarticles-meta">';
         if ($comment->getSpammer()) {
             $content[] = '      <span class="fa-stack fa-fw fpcm-ui-status-1" title="' . $this->language->translate('COMMMENT_SPAM') . '"><span class="fa fa-square fa-stack-2x"></span><span class="fa fa-flag fa-stack-1x fa-inverse"></span></span>';
         }
         if ($comment->getApproved()) {
             $content[] = '      <span class="fa-stack fa-fw fpcm-ui-status-1" title="' . $this->language->translate('COMMMENT_APPROVE') . '"><span class="fa fa-square fa-stack-2x"></span><span class="fa fa-check-circle-o fa-rotate-90 fa-stack-1x fa-inverse"></span></span>';
         }
         if ($comment->getPrivate()) {
             $content[] = '      <span class="fa-stack fa-fw fpcm-ui-status-1" title="' . $this->language->translate('COMMMENT_PRIVATE') . '"><span class="fa fa-square fa-stack-2x"></span><span class="fa fa-eye-slash fa-stack-1x fa-inverse"></span></span>';
         }
         $content[] = '  </td>';
         $content[] = '</tr>';
     }
     $content[] = '</table>';
     $this->content = implode(PHP_EOL, $content);
     $this->cache->write($this->content, $this->config->system_cache_timeout);
 }
Exemple #9
0
 public function process()
 {
     if (!parent::process()) {
         return false;
     }
     $eventResult = $this->events->runEvent('articleReplaceEditorPlugin');
     if (is_a($eventResult, '\\fpcm\\model\\abstracts\\articleEditor')) {
         $this->editorPlugin = $eventResult;
     } elseif ($this->config->system_editor) {
         $this->editorPlugin = new \fpcm\model\editor\htmlEditor();
     } else {
         $this->editorPlugin = new \fpcm\model\editor\tinymceEditor();
     }
     $this->view->setViewJsFiles($this->editorPlugin->getJsFiles());
     $this->view->setViewCssFiles($this->editorPlugin->getCssFiles());
     $viewVars = $this->editorPlugin->getViewVars();
     foreach ($viewVars as $key => $value) {
         $this->view->assign($key, $value);
     }
     $changeAuthor = $this->permissions->check(array('article' => 'authors'));
     $this->view->assign('changeAuthor', $changeAuthor);
     if ($changeAuthor) {
         $userlist = new \fpcm\model\users\userList();
         $changeuserList = array($this->lang->translate('EDITOR_CHANGEAUTHOR') => '') + $userlist->getUsersNameList();
         $this->view->assign('changeuserList', $changeuserList);
     }
     $this->view->assign('editorFile', $this->editorPlugin->getEditorTemplate());
     $this->view->assign('article', $this->article);
     $this->view->assign('categories', $this->categoryList->getCategoriesCurrentUser());
     $this->view->assign('commentEnabledGlobal', $this->config->system_comments_enabled);
     $this->view->assign('showArchiveStatus', true);
     $this->view->assign('showDraftStatus', true);
     $this->view->assign('isRevision', false);
     $this->view->assign('timesMode', false);
     $this->view->assign('userfields', $this->getUserFields());
     $twitter = new \fpcm\model\system\twitter();
     $this->view->assign('showTwitter', $twitter->checkRequirements());
     $this->jsVars = $this->editorPlugin->getJsVars();
     $this->jsVars += array('fpcmFileManagerUrl' => \fpcm\classes\baseconfig::$rootPath . 'index.php?module=files/list&mode=', 'fpcmFileManagerUrlMode' => 2);
     $jsLangVars = array('fileManagerHeadline' => $this->lang->translate('HL_FILES_MNG'));
     $this->view->addJsLangVars(array_merge($jsLangVars, $this->editorPlugin->getJsLangVars()));
     $this->view->addJsVars($this->jsVars);
     return true;
 }
Exemple #10
0
 /**
  * Content rendern
  */
 private function renderContent()
 {
     $userlist = new \fpcm\model\users\userList();
     $content = array();
     $content[] = '<table class="fpcm-ui-table fpcm-ui-users fpcm-ui-large-td">';
     $items = $userlist->getUsersActive();
     /* @var $item \fpcm\model\users\author */
     foreach ($items as $item) {
         $emailAddress = \fpcm\model\view\helper::escapeVal($item->getEmail());
         $content[] = '<tr class="fpcm-small-text">';
         $content[] = '  <td class="fpcm-ui-editbutton-col">';
         $content[] = '  <a class="fpcm-ui-button fpcm-ui-button-blank fpcm-email-btn" href="mailto:' . $emailAddress . '" target="_blank" title="' . $this->language->translate('GLOBAL_WRITEMAIL') . '">' . $this->language->translate('GLOBAL_WRITEMAIL') . '</a>';
         $content[] = '  </td>';
         $content[] = '  <td>';
         $content[] = '  <strong>' . \fpcm\model\view\helper::escapeVal($item->getDisplayname()) . '</strong><br>';
         $content[] = '  <span>' . $emailAddress . '</span>';
         $content[] = '  </td>';
         $content[] = '</tr>';
     }
     $content[] = '</table>';
     $this->content = implode(PHP_EOL, $content);
     $this->cache->write($this->content, $this->config->system_cache_timeout);
 }
Exemple #11
0
 /**
  * Prüft ob Kombination Benutzer und Passwort existiert
  * @param string $username
  * @param string $password
  * @return bool Ja, wenn Benutzer + Passwort vorhanden ist
  */
 public function checkUser($username, $password)
 {
     $userList = new \fpcm\model\users\userList();
     $userid = $userList->getUserIdByUsername($username);
     if (!$userid) {
         trigger_error('Login failed for username ' . $username . '! User not found. Request was made by ' . \fpcm\classes\http::getIp());
         return false;
     }
     $user = new \fpcm\model\users\author($userid);
     if ($user->getDisabled()) {
         trigger_error('Login failed for username ' . $username . '! User is disabled. Request was made by ' . \fpcm\classes\http::getIp());
         return \fpcm\model\users\author::AUTHOR_ERROR_DISABLED;
     }
     if (\fpcm\classes\security::createPasswordHash($password, $user->getPasswd()) == $user->getPasswd()) {
         $timer = time();
         $this->login = $timer;
         $this->lastaction = $timer;
         $this->logout = 0;
         $this->userid = $userid;
         $this->sessionid = \fpcm\classes\security::createSessionId();
         $this->ip = \fpcm\classes\http::getIp();
         $this->sessionExists = true;
         return true;
     }
     trigger_error('Login failed for username ' . $username . '! Wrong username or password. Request was made by ' . \fpcm\classes\http::getIp());
     return false;
 }
Exemple #12
0
 public function process()
 {
     if (!parent::process()) {
         return false;
     }
     $userRolls = new \fpcm\model\users\userRollList();
     $this->view->assign('userRolls', $userRolls->getUserRollsTranslated());
     $this->view->assign('languages', array_flip($this->lang->getLanguages()));
     $timezones = array();
     foreach ($this->getTimeZones() as $area => $zones) {
         foreach ($zones as $zone) {
             $timezones[$area][$zone] = $zone;
         }
     }
     $this->view->assign('timezoneAreas', $timezones);
     $this->view->assign('externalSave', true);
     $this->view->assign('articleLimitList', \fpcm\model\system\config::getAcpArticleLimits());
     $this->view->assign('defaultFontsizes', \fpcm\model\system\config::getDefaultFontsizes());
     $userList = new \fpcm\model\users\userList();
     $showDisableButton = !$this->userEnabled && ($this->userId == $this->session->getUserId() || $userList->countActiveUsers() == 1) ? false : true;
     $this->view->assign('showDisableButton', $showDisableButton);
     $this->view->setViewJsFiles(array(\fpcm\classes\loader::libGetFileUrl('password-generator', 'password-generator.min.js')));
     $this->view->addJsVars(array('fpcmNavigationActiveItemId' => 'submenu-itemnav-item-users', 'fpcmDtMasks' => \fpcm\classes\baseconfig::$dateTimeMasks));
     $this->view->render();
 }
Exemple #13
0
 /**
  * Request-Handler
  * @return boolean
  */
 public function request()
 {
     if ($this->session->exists()) {
         $this->redirect('system/dashboard');
     }
     if (!$this->maintenanceMode(false)) {
         return false;
     }
     $this->pageTokenOk = $this->checkPageToken();
     session_start();
     $this->loginLocked();
     if ($this->buttonClicked('login') && !is_null($this->getRequestVar('login')) && !$this->loginLocked && $this->pageTokenOk) {
         $data = $this->getRequestVar('login');
         $data = $this->events->runEvent('loginBefore', $data);
         $session = new \fpcm\model\system\session();
         $loginRes = $session->checkUser($data['username'], $data['password']);
         if ($loginRes === \fpcm\model\users\author::AUTHOR_ERROR_DISABLED) {
             $this->currentAttempts = $this->config->system_loginfailed_locked;
             $this->view->addErrorMessage('LOGIN_FAILED_DISABLED');
             if ($this->currentAttempts == $this->config->system_loginfailed_locked) {
                 $this->loginLocked();
             }
         } elseif ($loginRes === true && $session->save() && $session->setCookie()) {
             session_destroy();
             $this->redirect('system/dashboard');
         } else {
             $this->currentAttempts++;
             \fpcm\classes\http::setSessionVar('loginAttempts', $this->currentAttempts);
             $this->view->addErrorMessage('LOGIN_FAILED');
             if ($this->currentAttempts == $this->config->system_loginfailed_locked) {
                 $this->loginLocked();
             }
         }
     }
     if ($this->buttonClicked('reset') && !is_null($this->getRequestVar('username')) && !is_null($this->getRequestVar('email')) && !$this->loginLocked && $this->pageTokenOk) {
         $userList = new \fpcm\model\users\userList();
         $id = $userList->getUserIdByUsername($this->getRequestVar('username'));
         if (!$id) {
             $this->redirect();
         }
         $user = new \fpcm\model\users\author($id);
         if ($user->getEmail() == $this->getRequestVar('email') && $user->resetPassword()) {
             $this->view->addNoticeMessage('LOGIN_PASSWORD_RESET');
         } else {
             \fpcm\classes\logs::syslogWrite("Passwort reset for user id {$user->getUsername()} failed.");
             $this->view->addErrorMessage('LOGIN_PASSWORD_RESET_FAILED');
         }
     }
     if (!is_null($this->getRequestVar('nologin'))) {
         $this->view->addErrorMessage('LOGIN_REQUIRED');
     }
     $reset = !is_null($this->getRequestVar('reset')) ? true : false;
     $this->view->assign('resetPasswort', $reset);
     $this->view->assign('noFullWrapper', true);
     return true;
 }