public function content_edit($APP) { $APP->set('MODUL_ID', 52); $USER_RIGHTS = parent::checkUserModulRights($APP->get('MODUL_ID'), $APP->get('LOGIN_USER_RIGHTS')); if ($USER_RIGHTS == false) { $APP->get('CONSTRUCTR_LOG')->write('User ' . $APP->get('SESSION.username') . ' missing USER-RIGHTS for modul ' . $APP->get('MODUL_ID')); $APP->reroute($APP->get('CONSTRUCTR_BASE_URL') . '/constructr/no-rights'); } $PAGE_ID = filter_var($APP->get('PARAMS.page_id'), FILTER_SANITIZE_NUMBER_INT); $APP->set('PAGE_ID', $PAGE_ID); $APP->set('PAGE', $APP->get('DBCON')->exec(['SELECT * FROM constructr_pages WHERE constructr_pages_id=:PAGE_ID LIMIT 1;'], [[':PAGE_ID' => $PAGE_ID]])); $CONTENT_ID = filter_var($APP->get('PARAMS.content_id'), FILTER_SANITIZE_NUMBER_INT); $APP->set('CONTENT_ID', $CONTENT_ID); $CSRF = parent::csrf(); $APP->set('CSRF', $CSRF); $APP->set('SESSION.csrf', $CSRF); $ADDITIVE = parent::additive(); $APP->set('ADDITIVE', $ADDITIVE); $APP->set('SESSION.additive', $ADDITIVE); $TRIPPLE_ADDITIVE = $ADDITIVE . $CSRF; $APP->set('TRIPPLE_ADDITIVE', $TRIPPLE_ADDITIVE); $APP->set('SESSION.tripple_additive', $TRIPPLE_ADDITIVE); $APP->set('CONTENT', $APP->get('DBCON')->exec(['SELECT * FROM constructr_content WHERE constructr_content_id=:CONTENT_ID AND constructr_content_page_id=:PAGE_ID LIMIT 1;'], [[':CONTENT_ID' => $CONTENT_ID, ':PAGE_ID' => $PAGE_ID]])); $APP->set('CONTENT_COUNTR', 0); $APP->set('CONTENT_COUNTR', count($APP->get('CONTENT'))); $APP->set('TEMPLATE', $APP->get('DBCON')->exec(['SELECT constructr_pages_template FROM constructr_pages WHERE constructr_pages_id=:PAGE_ID;'], [[':PAGE_ID' => $PAGE_ID]])); $APP->set('TEMPLATE_FILE', $APP->get('TEMPLATE.0.constructr_pages_template')); $TEMPLATE_TEXT = file_get_contents($APP->get('TEMPLATES') . $APP->get('TEMPLATE_FILE')); preg_match_all("/({{@ CONSTRUCTR_MAPPING\\()+([\\w-])+(\\) @}})/", $TEMPLATE_TEXT, $MATCH); $CONSTRUCTR_TPL_MAPPINGS = []; if ($MATCH[0]) { $i = 0; foreach ($MATCH[0] as $KEY => $MATCHR) { $CONSTRUCTR_TPL_MAPPINGS[$i] = $MATCHR; $i++; } } $APP->set('CONSTRUCTR_TPL_MAPPINGS', $CONSTRUCTR_TPL_MAPPINGS); $H = opendir($APP->get('UPLOADS')); $IMAGES = []; $FILES = []; $i = 0; while ($FILE = readdir($H)) { if ($FILE != '.' && $FILE != '..' && $FILE != '.empty_file' && $FILE != 'index.php' && $FILE != 'TMP') { $FT = strtolower(strrchr($FILE, '.')); if ($FT == '.jpg' || $FT == '.jpeg' || $FT == '.gif' || $FT == '.png' || $FT == '.svg') { $IMAGES[$i] = $FILE; $i++; } else { $FILES[$i] = $FILE; $i++; } } } closedir($H); uksort($IMAGES, "strnatcmp"); uksort($FILES, "strnatcmp"); $APP->set('IMAGES', $IMAGES); $APP->set('FILES', $FILES); $APP->set('PAGES', $APP->get('DBCON')->exec(['SELECT * FROM constructr_pages WHERE constructr_pages_active=1 AND constructr_pages_nav_visible=1 ORDER BY constructr_pages_order ASC;'])); if ($APP->get('CONTENT_COUNTR') == 1) { echo Template::instance()->render('CONSTRUCTR-CMS/TEMPLATES/constructr_admin_content_edit.html', 'text/html'); } else { $APP->set('EDIT', 'no-success'); $APP->reroute($APP->get('CONSTRUCTR_BASE_URL') . '/constructr/content/' . $PAGE_ID . '/?edit=no-success'); } }
public function page_management_new($APP) { $APP->set('MODUL_ID', 31); $USER_RIGHTS = parent::checkUserModulRights($APP->get('MODUL_ID'), $APP->get('LOGIN_USER_RIGHTS')); if ($USER_RIGHTS == false) { $APP->get('CONSTRUCTR_LOG')->write('User ' . $APP->get('SESSION.username') . ' missing USER-RIGHTS for modul ' . $APP->get('MODUL_ID')); $APP->reroute($APP->get('CONSTRUCTR_BASE_URL') . '/constructr/no-rights'); } $CSRF = parent::csrf(); $APP->set('CSRF', $CSRF); $APP->set('SESSION.csrf', $CSRF); $ADDITIVE = parent::additive(); $APP->set('ADDITIVE', $ADDITIVE); $APP->set('SESSION.additive', $ADDITIVE); $TRIPPLE_ADDITIVE = $ADDITIVE . $CSRF; $APP->set('TRIPPLE_ADDITIVE', $TRIPPLE_ADDITIVE); $APP->set('SESSION.tripple_additive', $TRIPPLE_ADDITIVE); $APP->set('PAGES', $APP->get('DBCON')->exec(['SELECT * FROM constructr_pages ORDER BY constructr_pages_order ASC;'])); $APP->set('PAGE_COUNTR', count($APP->get('PAGES'))); $APP->set('TEMPLATES', array_diff(scandir(__DIR__ . '/../../THEMES'), ['..', '.', '.empty_file', 'ASSETS'])); echo Template::instance()->render('CONSTRUCTR-CMS/TEMPLATES/constructr_admin_pagemanagement_new.html', 'text/html'); }
public function user_management_edit($APP) { $APP->set('MODUL_ID', 42); $USER_RIGHTS = parent::checkUserModulRights($APP->get('MODUL_ID'), $APP->get('LOGIN_USER_RIGHTS')); if ($USER_RIGHTS == false) { $APP->get('CONSTRUCTR_LOG')->write('User ' . $APP->get('SESSION.username') . ' missing USER-RIGHTS for modul ' . $APP->get('MODUL_ID')); $APP->reroute($APP->get('CONSTRUCTR_BASE_URL') . '/constructr/no-rights'); } $USER_ID = filter_var($APP->get('PARAMS.user_id'), FILTER_SANITIZE_NUMBER_INT); $CSRF = parent::csrf(); $APP->set('CSRF', $CSRF); $APP->set('SESSION.csrf', $CSRF); $ADDITIVE = parent::additive(); $APP->set('ADDITIVE', $ADDITIVE); $APP->set('SESSION.additive', $ADDITIVE); $TRIPPLE_ADDITIVE = $ADDITIVE . $CSRF; $APP->set('TRIPPLE_ADDITIVE', $TRIPPLE_ADDITIVE); $APP->set('SESSION.tripple_additive', $TRIPPLE_ADDITIVE); $APP->set('USER', $APP->get('DBCON')->exec(['SELECT * FROM constructr_backenduser WHERE constructr_user_id=:USER_ID LIMIT 1;'], [[':USER_ID' => $USER_ID]])); $APP->set('USER_COUNTER', count($APP->get('USER'))); echo Template::instance()->render('CONSTRUCTR-CMS/TEMPLATES/constructr_admin_usermanagement_edit.html', 'text/html'); }
public function uploads_new($APP) { $APP->set('MODUL_ID', 61); $USER_RIGHTS = parent::checkUserModulRights($APP->get('MODUL_ID'), $APP->get('LOGIN_USER_RIGHTS')); if ($USER_RIGHTS == false) { $APP->get('CONSTRUCTR_LOG')->write('User ' . $APP->get('SESSION.username') . ' missing USER-RIGHTS for modul ' . $APP->get('MODUL_ID')); $APP->reroute($APP->get('CONSTRUCTR_BASE_URL') . '/constructr/no-rights'); } $CSRF = parent::csrf(); $APP->set('CSRF', $CSRF); $APP->set('SESSION.csrf', $CSRF); $ADDITIVE = parent::additive(); $APP->set('ADDITIVE', $ADDITIVE); $APP->set('SESSION.additive', $ADDITIVE); $TRIPPLE_ADDITIVE = $ADDITIVE . $CSRF; $APP->set('TRIPPLE_ADDITIVE', $TRIPPLE_ADDITIVE); $APP->set('SESSION.tripple_additive', $TRIPPLE_ADDITIVE); echo Template::instance()->render('CONSTRUCTR-CMS/TEMPLATES/constructr_admin_uploads_new.html', 'text/html'); }