mirror of https://github.com/Mowie/Mowie
parent
a784c5a574
commit
86f9367424
|
@ -66,8 +66,8 @@ if (isset($_POST['submit']))
|
|||
$CONFIG['Templating']['tpl_title'] = 'title';
|
||||
$CONFIG['Templating']['tpl_content'] = 'content';
|
||||
$CONFIG['Templating']['tpl_webUri'] = 'website_uri';
|
||||
$CONFIG['Versioning']['version'] = '0.95 Beta';
|
||||
$CONFIG['Versioning']['version_num'] = 6;
|
||||
$CONFIG['Versioning']['version'] = '0.96';
|
||||
$CONFIG['Versioning']['version_num'] = 9;
|
||||
$CONFIG['Versioning']['update_uri'][] = 'https://cdn.kola-entertainments.de/cms/';
|
||||
|
||||
$CONFIG['Mail']['smtp'] = false;
|
||||
|
|
|
@ -73,6 +73,9 @@ $lang['general_inactive'] = 'Nicht aktiviert';
|
|||
$lang['general_activate'] = 'Aktivieren';
|
||||
$lang['general_deactivate'] = 'Deaktivieren';
|
||||
$lang['general_save_changes'] = 'Änderungen speichern';
|
||||
$lang['general_needs_other_app'] = 'Diese App benötgt die andere App "%1$s" um ordnungsgemäß zu funktionieren.';
|
||||
$lang['general_needs_other_version'] = 'Diese App benötigt mindestens Mowie in Version %1$s.';
|
||||
$lang['general_needs_other_php'] = 'Diese App benötigt mindestens PHP in Version %1$s.';
|
||||
|
||||
//General Config
|
||||
$lang['general_config'] = 'Systemkonfiguration';
|
||||
|
|
|
@ -85,6 +85,9 @@ $lang['general_version'] = 'Version';
|
|||
$lang['general_database'] = 'Database';
|
||||
$lang['general_create_backup'] = 'Create Database Backup';
|
||||
$lang['general_go_phpmyadmin'] = 'phpmyadmin';
|
||||
$lang['general_needs_other_app'] = 'This app needs the app "%1$s" to function properly.';
|
||||
$lang['general_needs_other_version'] = 'This app needs at least Mowie version %1$s.';
|
||||
$lang['general_needs_other_php'] = 'This app needs at least PHP version %1$s.';
|
||||
|
||||
/*
|
||||
* Manage Admins
|
||||
|
|
|
@ -9,7 +9,9 @@ $_CONF['app_version'] = 'v0.9 Beta';
|
|||
$_CONF['base_file'] = 'nav.php';
|
||||
$_CONF['type'] = 'static';
|
||||
|
||||
$_CONF['menu_top'] = '<i class="fa fa-bars"></i> '.$GLOBALS['lang']->get('nav_title');
|
||||
$_CONF['menu_top'] = '<i class="fa fa-bars"></i> ' . $GLOBALS['lang']->get('nav_title');
|
||||
$_CONF['menu'] = ['menu_top' => 'index.php'];
|
||||
|
||||
$_CONF['css'] = ['css/nav.css'];
|
||||
$_CONF['css'] = ['css/nav.css'];
|
||||
|
||||
$_CONF['dependencies'] = ['apps' => ['SimplePages']];
|
|
@ -34,12 +34,5 @@ if(file_exists($iniFile))
|
|||
{
|
||||
$config = parse_ini_file($iniFile);
|
||||
$confirmationRequierd = $config['confirmationRequierd'];
|
||||
//$confirmationUserMail = $config['confirmationUserMail'];
|
||||
$confirmationUser = $config['confirmationUser'];
|
||||
|
||||
//Get the user's email
|
||||
/*$db->setCol('system_admins');
|
||||
$db->data['id'] = $confirmationUser;
|
||||
$db->get();
|
||||
if(isset($db->data[0])) $confirmationUserMail = $db->data[0]['mail'];*/
|
||||
}
|
||||
|
|
47
inc/apps.php
47
inc/apps.php
|
@ -8,6 +8,7 @@
|
|||
class apps
|
||||
{
|
||||
private $apps;
|
||||
public $unresolvedDependencies;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
@ -15,13 +16,13 @@ class apps
|
|||
$i = 1;
|
||||
$appdir = 'apps/';
|
||||
|
||||
//When the appdir wasn't found after 20 iterations, throw an error to prevent endless searching
|
||||
while(!file_exists($appdir) && $i<21)
|
||||
{
|
||||
$appdir = '../' . $appdir;
|
||||
$i++;
|
||||
}
|
||||
|
||||
//When the appdir wasn't found after 20 iterations, throw an error to prevent endless searching
|
||||
if(!file_exists($appdir)) echo 'Could not find App dir.';
|
||||
|
||||
//Loop through the apps
|
||||
|
@ -73,4 +74,48 @@ class apps
|
|||
return $this->apps[$app];
|
||||
}
|
||||
}
|
||||
|
||||
//Check for app dependencies
|
||||
public function checkDependencies($app)
|
||||
{
|
||||
$appconf = $this->getApp($app);
|
||||
$dep = true;
|
||||
if(isset($appconf['dependencies']))
|
||||
{
|
||||
//Min System Build
|
||||
if(isset($appconf['dependencies']['mowie-version']))
|
||||
{
|
||||
if(!version_compare($GLOBALS['MCONF']['version'], $appconf['dependencies']['mowie-version'], '>='))
|
||||
{
|
||||
$this->unresolvedDependencies['mowie-version'] = $appconf['dependencies']['mowie-version'];
|
||||
$dep = false;
|
||||
}
|
||||
}
|
||||
|
||||
//Required Apps
|
||||
if(isset($appconf['dependencies']['apps']))
|
||||
{
|
||||
foreach ($appconf['dependencies']['apps'] as $dep_app)
|
||||
{
|
||||
if (!$this->appExists($dep_app))
|
||||
{
|
||||
$this->unresolvedDependencies['apps'][] = $dep_app;
|
||||
$dep = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Required PHP-Version
|
||||
if(isset($appconf['dependencies']['php']))
|
||||
{
|
||||
if(!version_compare(PHP_VERSION, $appconf['dependencies']['php'], '>='))
|
||||
{
|
||||
$this->unresolvedDependencies['php'] = $appconf['dependencies']['php'];
|
||||
$dep = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $dep;
|
||||
}
|
||||
}
|
|
@ -177,9 +177,15 @@ function is_loggedin()
|
|||
//Print header
|
||||
function printHeader($title)
|
||||
{
|
||||
|
||||
//Globals
|
||||
global $apps;
|
||||
global $MCONF;
|
||||
global $lang;
|
||||
|
||||
if (!is_loggedin())
|
||||
{
|
||||
$title = $GLOBALS['lang']->get('login');
|
||||
$title = $lang->get('login');
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['direct'])) //Send just the Content of the current page
|
||||
|
@ -204,9 +210,9 @@ function printHeader($title)
|
|||
exit;
|
||||
}
|
||||
} elseif (isset($_GET['css'])) //Send extra CSS Files for Apps
|
||||
{
|
||||
{
|
||||
header('Content-Type: application/json');
|
||||
$app = str_replace(substr(
|
||||
$app = str_replace(substr(
|
||||
substr(
|
||||
$_SERVER['REQUEST_URI'],
|
||||
(strpos($_SERVER['REQUEST_URI'],
|
||||
|
@ -225,30 +231,30 @@ function printHeader($title)
|
|||
'/'
|
||||
)
|
||||
), '',
|
||||
substr(
|
||||
substr($_SERVER['REQUEST_URI'], (strpos($_SERVER['REQUEST_URI'], '/apps/') + 6)), 0
|
||||
));
|
||||
substr(
|
||||
substr($_SERVER['REQUEST_URI'], (strpos($_SERVER['REQUEST_URI'], '/apps/') + 6)), 0
|
||||
));
|
||||
|
||||
$appInfo = $GLOBALS['apps']->getApp($app);
|
||||
$appInfo = $apps->getApp($app);
|
||||
if(isset($appInfo['css']))
|
||||
{
|
||||
echo json_encode(['css' => true, 'css_files' => $appInfo['css'], 'fullUri' => $GLOBALS['MCONF']['web_uri'].'apps/'.$app.'/']);
|
||||
echo json_encode(['css' => true, 'css_files' => $appInfo['css'], 'fullUri' => $MCONF['web_uri'].'apps/'.$app.'/']);
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
echo json_encode(['css' => false]);
|
||||
}
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
//Get Apps, build app-menu (We're building the menu here and output it later because we want the name of the current app to use it for App-CSS)
|
||||
$appmenu = '';
|
||||
$apps = $GLOBALS['apps']->getApps();
|
||||
$appsLoop = $apps->getApps();
|
||||
$appCurr = '';
|
||||
foreach ($apps as $app => $appconf)
|
||||
foreach ($appsLoop as $app => $appconf)
|
||||
{
|
||||
if (isset($appconf['menu_top']) && $appconf['menu_top'] !== '')
|
||||
{
|
||||
|
@ -261,11 +267,11 @@ function printHeader($title)
|
|||
|
||||
if (array_key_exists('menu_top', $appconf['menu']))
|
||||
{
|
||||
$appmenu .= "\n" . '<li' . $now . ' id="mw-menu-apps-' . $app . '-top"><a href="' . $GLOBALS['MCONF']['home_uri'] . 'apps/' . $app . '/' . $appconf['menu']['menu_top'] . '">' . $appconf['menu_top'] . '</a>' . "\n";
|
||||
$appmenu .= "\n" . '<li' . $now . ' id="mw-menu-apps-' . $app . '-top"><a href="' . $MCONF['home_uri'] . 'apps/' . $app . '/' . $appconf['menu']['menu_top'] . '">' . $appconf['menu_top'] . '</a>' . "\n";
|
||||
} else
|
||||
{
|
||||
$first_itm = array_keys($appconf['menu']);
|
||||
$appmenu .= "\n" . '<li' . $now . ' id="mw-menu-apps-' . $app . '-top"><a href="' . $GLOBALS['MCONF']['home_uri'] . 'apps/' . $app . '/' . $appconf['menu'][$first_itm[0]] . '">' . $appconf['menu_top'] . '<i class="fa fa-chevron-right sub_menu"></i></a>' . "\n" . '<ul>';
|
||||
$appmenu .= "\n" . '<li' . $now . ' id="mw-menu-apps-' . $app . '-top"><a href="' . $MCONF['home_uri'] . 'apps/' . $app . '/' . $appconf['menu'][$first_itm[0]] . '">' . $appconf['menu_top'] . '<i class="fa fa-chevron-right sub_menu"></i></a>' . "\n" . '<ul>';
|
||||
foreach ($appconf['menu'] as $app_name => $app_name_url)
|
||||
{
|
||||
$now = '';
|
||||
|
@ -273,7 +279,7 @@ function printHeader($title)
|
|||
{
|
||||
$now = ' class="active"';
|
||||
}
|
||||
$appmenu .= '<li' . $now . ' id="mw-menu-apps-' . $app . '-' . str_replace(['.php', '?', '&'], '', str_replace('/', '-', $app_name_url)) . '"><a href="' . $GLOBALS['MCONF']['home_uri'] . 'apps/' . $app . '/' . $app_name_url . '">' . $app_name . '</a></li>' . "\n";
|
||||
$appmenu .= '<li' . $now . ' id="mw-menu-apps-' . $app . '-' . str_replace(['.php', '?', '&'], '', str_replace('/', '-', $app_name_url)) . '"><a href="' . $MCONF['home_uri'] . 'apps/' . $app . '/' . $app_name_url . '">' . $app_name . '</a></li>' . "\n";
|
||||
}
|
||||
$appmenu .= '</ul></li>' . "\n";
|
||||
}
|
||||
|
@ -281,34 +287,34 @@ function printHeader($title)
|
|||
}
|
||||
}
|
||||
|
||||
//<link rel="stylesheet prefetch" href="' . $GLOBALS['MCONF']['web_uri'] . 'css/video-js.css" type="text/css"/>
|
||||
//<link rel="stylesheet prefetch" href="' . $MCONF['web_uri'] . 'css/video-js.css" type="text/css"/>
|
||||
echo '<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>' . $title . ' | ' . $GLOBALS['lang']->get('admin_title') . ' | ' . $GLOBALS['MCONF']['title'] . '</title>
|
||||
<link rel="shourtcut icon" href="' . $GLOBALS['MCONF']['web_uri'] . 'favicon.ico"/>
|
||||
<link rel="stylesheet" href="' . $GLOBALS['MCONF']['web_uri'] . 'admin/assets/bootstrap.min.css" type="text/css"/>
|
||||
<link rel="stylesheet" href="' . $GLOBALS['MCONF']['web_uri'] . 'admin/assets/admin.css" type="text/css"/>
|
||||
<title>' . $title . ' | ' . $lang->get('admin_title') . ' | ' . $MCONF['title'] . '</title>
|
||||
<link rel="shourtcut icon" href="' . $MCONF['web_uri'] . 'favicon.ico"/>
|
||||
<link rel="stylesheet" href="' . $MCONF['web_uri'] . 'admin/assets/bootstrap.min.css" type="text/css"/>
|
||||
<link rel="stylesheet" href="' . $MCONF['web_uri'] . 'admin/assets/admin.css" type="text/css"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
|
||||
<script src="' . $GLOBALS['MCONF']['web_uri'] . 'admin/assets/js/jquery.min.js"></script>
|
||||
<script src="' . $MCONF['web_uri'] . 'admin/assets/js/jquery.min.js"></script>
|
||||
|
||||
<script src="' . $GLOBALS['MCONF']['web_uri'] . 'admin/assets/js/page.js"></script>
|
||||
<script src="' . $GLOBALS['MCONF']['web_uri'] . 'admin/assets/js/page.bodyparser.js"></script>
|
||||
<script src="' . $MCONF['web_uri'] . 'admin/assets/js/page.js"></script>
|
||||
<script src="' . $MCONF['web_uri'] . 'admin/assets/js/page.bodyparser.js"></script>
|
||||
<script>
|
||||
page.base(\'' . $GLOBALS['MCONF']['home_uri'] . '\');
|
||||
page.base(\'' . $MCONF['home_uri'] . '\');
|
||||
</script>
|
||||
';
|
||||
//Get App-CSS and output it
|
||||
if(isset($apps[$appCurr]['css']))
|
||||
//Get App-CSS and output it
|
||||
if(isset($appsLoop[$appCurr]['css']))
|
||||
{
|
||||
foreach ($apps[$appCurr]['css'] as $style)
|
||||
foreach ($appsLoop[$appCurr]['css'] as $style)
|
||||
{
|
||||
echo ' <link rel="stylesheet" href="' . $GLOBALS['MCONF']['web_uri'] . 'apps/'.$appCurr.'/'.$style.'" type="text/css"/>';
|
||||
echo ' <link rel="stylesheet" href="' . $MCONF['web_uri'] . 'apps/'.$appCurr.'/'.$style.'" type="text/css"/>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
echo '
|
||||
</head>
|
||||
<body>';
|
||||
if (is_loggedin())
|
||||
|
@ -328,8 +334,8 @@ echo '
|
|||
//<img src="http://www.gravatar.com/avatar/' . md5(strtolower(trim($_SESSION['mail']))) . '?s=40&d=mm" alt=""/>
|
||||
echo '<img src="http://www.gravatar.com/avatar/' . md5(strtolower(trim($_SESSION['mail']))) . '?s=40&d=mm" alt=""/> '.$_SESSION['user'] . '</span> <span class="fa fa-chevron-down"></span></p>
|
||||
<ul>
|
||||
<li><a href="' . $GLOBALS['MCONF']['web_uri'] . 'admin/user_settings.php"><span class="fa fa-gear"></span> ' . $GLOBALS['lang']->get('settings') . '</a></li>
|
||||
<li><a href="' . $GLOBALS['MCONF']['web_uri'] . 'admin/logout.php" rel="external"><span class="fa fa-sign-out"></span> ' . $GLOBALS['lang']->get('logout') . '</a></li>
|
||||
<li><a href="' . $MCONF['web_uri'] . 'admin/user_settings.php"><span class="fa fa-gear"></span> ' . $lang->get('settings') . '</a></li>
|
||||
<li><a href="' . $MCONF['web_uri'] . 'admin/logout.php" rel="external"><span class="fa fa-sign-out"></span> ' . $lang->get('logout') . '</a></li>
|
||||
</ul>
|
||||
</label>
|
||||
</div>
|
||||
|
@ -339,52 +345,52 @@ echo '
|
|||
<input type="checkbox" id="show-menu" role="button">
|
||||
<nav id="topnav">
|
||||
<header>
|
||||
<a href="' . $GLOBALS['MCONF']['home_uri'] . 'admin/"><img src="' . $GLOBALS['MCONF']['web_uri'] . 'admin/assets/Logo.svg" alt="Mowie CMS"/></a>
|
||||
<a href="' . $MCONF['home_uri'] . 'admin/"><img src="' . $MCONF['web_uri'] . 'admin/assets/Logo.svg" alt="Mowie CMS"/></a>
|
||||
</header>
|
||||
<ul id="menulist"><li><a href="' . $GLOBALS['MCONF']['home_uri'] . '" target="_blank"><i class="fa fa-external-link"></i> ' . $GLOBALS['lang']->get('main_page') . '</a></li>
|
||||
<ul id="menulist"><li><a href="' . $MCONF['home_uri'] . '" target="_blank"><i class="fa fa-external-link"></i> ' . $lang->get('main_page') . '</a></li>
|
||||
<li';
|
||||
if ($title == $GLOBALS['lang']->get('dashboard_title')) echo ' class="active"';
|
||||
echo ' id="mw-menu-admin-"><a href="' . $GLOBALS['MCONF']['home_uri'] . 'admin/"><i class="fa fa-dashboard"></i> ' . $GLOBALS['lang']->get('dashboard') . '</a></li>';
|
||||
if ($title == $lang->get('dashboard_title')) echo ' class="active"';
|
||||
echo ' id="mw-menu-admin-"><a href="' . $MCONF['home_uri'] . 'admin/"><i class="fa fa-dashboard"></i> ' . $lang->get('dashboard') . '</a></li>';
|
||||
|
||||
if (hasPerm('manage_system', 'System'))
|
||||
{
|
||||
echo '<li';
|
||||
if ($title == $GLOBALS['lang']->get('general_config')) echo ' class="active"';
|
||||
echo ' id="mw-menu-admin-general_config"><a href="' . $GLOBALS['MCONF']['home_uri'] . 'admin/general_config.php"><i
|
||||
if ($title == $lang->get('general_config')) echo ' class="active"';
|
||||
echo ' id="mw-menu-admin-general_config"><a href="' . $MCONF['home_uri'] . 'admin/general_config.php"><i
|
||||
class="fa fa-sliders"></i>
|
||||
' . $GLOBALS['lang']->get('general_config') . '</a></li>';
|
||||
' . $lang->get('general_config') . '</a></li>';
|
||||
}
|
||||
if (hasPerm('manage_admins', 'System'))
|
||||
{
|
||||
?>
|
||||
<li<?php
|
||||
if ($title == $GLOBALS['lang']->get('admins_list') || $title == $GLOBALS['lang']->get('admins_create_new') || $title == $GLOBALS['lang']->get('admins_groups') || $title == $GLOBALS['lang']->get('admins_permissions')) echo ' class="active"';
|
||||
?> id="mw-menu-admin-users-top"><a href="<?php echo $GLOBALS['MCONF']['home_uri']; ?>admin/users.php"><i
|
||||
class="fa fa-group"></i>
|
||||
<?php echo $GLOBALS['lang']->get('admins_title'); ?><i class="fa fa-chevron-right sub_menu"></i></a>
|
||||
<ul>
|
||||
<li id="mw-menu-admin-users"><a
|
||||
href="<?php echo $GLOBALS['MCONF']['home_uri']; ?>admin/users.php"<?php
|
||||
if ($title == $GLOBALS['lang']->get('admins_list')) echo ' class="active"';
|
||||
?>><i class="fa fa-id-card-o"></i> <?php echo $GLOBALS['lang']->get('admins_list'); ?></a></li>
|
||||
<li id="mw-menu-admin-roles"><a
|
||||
href="<?php echo $GLOBALS['MCONF']['home_uri']; ?>admin/roles.php"<?php
|
||||
if ($title == $GLOBALS['lang']->get('admins_groups')) echo ' class="active"';
|
||||
?>><i class="fa fa-group"></i> <?php echo $GLOBALS['lang']->get('admins_groups'); ?></a>
|
||||
</li>
|
||||
<li id="mw-menu-admin-permissions"><a
|
||||
href="<?php echo $GLOBALS['MCONF']['home_uri']; ?>admin/permissions.php"<?php
|
||||
if ($title == $GLOBALS['lang']->get('admins_permissions')) echo ' class="active"';
|
||||
?>><i class="fa fa-exchange"></i> <?php echo $GLOBALS['lang']->get('admins_permissions'); ?>
|
||||
</a>
|
||||
</li>
|
||||
<li id="mw-menu-admin-new_user"><a
|
||||
href="<?php echo $GLOBALS['MCONF']['home_uri']; ?>admin/new_user.php"<?php
|
||||
if ($title == $GLOBALS['lang']->get('admins_create_new')) echo ' class="active"';
|
||||
?>><i class="fa fa-user-plus"></i> <?php echo $GLOBALS['lang']->get('admins_create_new'); ?>
|
||||
</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li<?php
|
||||
if ($title == $lang->get('admins_list') || $title == $lang->get('admins_create_new') || $title == $lang->get('admins_groups') || $title == $lang->get('admins_permissions')) echo ' class="active"';
|
||||
?> id="mw-menu-admin-users-top"><a href="<?php echo $MCONF['home_uri']; ?>admin/users.php"><i
|
||||
class="fa fa-group"></i>
|
||||
<?php echo $lang->get('admins_title'); ?><i class="fa fa-chevron-right sub_menu"></i></a>
|
||||
<ul>
|
||||
<li id="mw-menu-admin-users"><a
|
||||
href="<?php echo $MCONF['home_uri']; ?>admin/users.php"<?php
|
||||
if ($title == $lang->get('admins_list')) echo ' class="active"';
|
||||
?>><i class="fa fa-id-card-o"></i> <?php echo $lang->get('admins_list'); ?></a></li>
|
||||
<li id="mw-menu-admin-roles"><a
|
||||
href="<?php echo $MCONF['home_uri']; ?>admin/roles.php"<?php
|
||||
if ($title == $lang->get('admins_groups')) echo ' class="active"';
|
||||
?>><i class="fa fa-group"></i> <?php echo $lang->get('admins_groups'); ?></a>
|
||||
</li>
|
||||
<li id="mw-menu-admin-permissions"><a
|
||||
href="<?php echo $MCONF['home_uri']; ?>admin/permissions.php"<?php
|
||||
if ($title == $lang->get('admins_permissions')) echo ' class="active"';
|
||||
?>><i class="fa fa-exchange"></i> <?php echo $lang->get('admins_permissions'); ?>
|
||||
</a>
|
||||
</li>
|
||||
<li id="mw-menu-admin-new_user"><a
|
||||
href="<?php echo $MCONF['home_uri']; ?>admin/new_user.php"<?php
|
||||
if ($title == $lang->get('admins_create_new')) echo ' class="active"';
|
||||
?>><i class="fa fa-user-plus"></i> <?php echo $lang->get('admins_create_new'); ?>
|
||||
</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
@ -393,10 +399,10 @@ echo '
|
|||
echo '</ul>
|
||||
<div class="copy"> © 2016 <a href="http://mowie.cc">Mowie</a></div><div class="langselect"><a id="langselectbtn"><i class="fa fa-globe"></i> </a><div class="langs">';
|
||||
//Lang
|
||||
$langs = $GLOBALS['lang']->getLangs();
|
||||
foreach ($langs as $lang)
|
||||
$langs = $lang->getLangs();
|
||||
foreach ($langs as $langS)
|
||||
{
|
||||
echo '<a onclick="changeLang(\'' . $lang['LangCode'] . '\')">' . $lang['Lang'] . '</a>';
|
||||
echo '<a onclick="changeLang(\'' . $langS['LangCode'] . '\')">' . $langS['Lang'] . '</a>';
|
||||
}
|
||||
echo '</div></div></nav>
|
||||
<label for="show-menu" class="mobile-overlay"></label>
|
||||
|
@ -404,92 +410,123 @@ echo '
|
|||
<div class="loader-overlay"></div>
|
||||
<div id="loader">
|
||||
';
|
||||
|
||||
//Check App dependencies
|
||||
if(!$apps->checkDependencies($appCurr))
|
||||
{
|
||||
foreach($apps->unresolvedDependencies as $dependency_type => $dependency)
|
||||
{
|
||||
//Apps
|
||||
if($dependency_type == 'apps')
|
||||
{
|
||||
foreach ($dependency as $depApp)
|
||||
{
|
||||
echo msg('info', sprintf($lang->get('general_needs_other_app'), $depApp));
|
||||
}
|
||||
}
|
||||
|
||||
//Mowie-Version
|
||||
if($dependency_type == 'mowie-version')
|
||||
{
|
||||
echo msg('info', sprintf($lang->get('general_needs_other_version'), $dependency));
|
||||
}
|
||||
|
||||
//Mowie-Version
|
||||
if($dependency_type == 'php')
|
||||
{
|
||||
echo msg('info', sprintf($lang->get('general_needs_other_php'), $dependency));
|
||||
}
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
} else
|
||||
{
|
||||
?>
|
||||
<div class="login_wrapper">
|
||||
<img src="<?php echo $GLOBALS['MCONF']['web_uri']; ?>admin/assets/Logo.svg" alt="Mowie"/>
|
||||
<div class="login_container">
|
||||
<div class="langselect"><a id="langselectbtn"><i class="fa fa-globe"></i> </a>
|
||||
<div class="langs">
|
||||
<div class="login_wrapper">
|
||||
<img src="<?php echo $MCONF['web_uri']; ?>admin/assets/Logo.svg" alt="Mowie"/>
|
||||
<div class="login_container">
|
||||
<div class="langselect"><a id="langselectbtn"><i class="fa fa-globe"></i> </a>
|
||||
<div class="langs">
|
||||
<?php
|
||||
//Lang
|
||||
$langs = $GLOBALS['lang']->getLangs();
|
||||
$langs = $lang->getLangs();
|
||||
foreach ($langs as $lang)
|
||||
{
|
||||
echo '<a onclick="changeLang(\'' . $lang['LangCode'] . '\')">' . $lang['Lang'] . '</a>';
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<h1><?php echo $GLOBALS['lang']->get('login'); ?></h1>
|
||||
<form action="<?php echo $GLOBALS['MCONF']['web_uri']; ?>admin/login.php" method="post"
|
||||
id="login">
|
||||
<input type="text" placeholder="<?php echo $GLOBALS['lang']->get('username'); ?>" id="username"
|
||||
autofocus/><br/>
|
||||
<input type="password" placeholder="<?php echo $GLOBALS['lang']->get('password'); ?>"
|
||||
id="pw"/><br/>
|
||||
<div id="2faContainer" style="display: none">
|
||||
<input type="text" id="2fa" autocomplete="off"
|
||||
placeholder="<?php echo $GLOBALS['lang']->get('2fa_code'); ?>"><br/>
|
||||
</div>
|
||||
<a href="reset-pw.php"><?php echo $GLOBALS['lang']->get('reset_pass_lost');?></a><br/>
|
||||
<input type="submit" value="<?php echo $GLOBALS['lang']->get('login'); ?>"/>
|
||||
</form>
|
||||
<div id="msg"></div>
|
||||
</div>
|
||||
<p style="text-align: center;color: #fff;text-shadow: 1px 1px 1px #555;">© 2016 <a
|
||||
href="http://mowie.cc" style="color: #fff;">Mowie</a></p>
|
||||
</div>
|
||||
<script>
|
||||
$("#login").submit(function () {
|
||||
if ($('#username').val() == '' || $('#pw').val() == '') {
|
||||
$('#msg').html('<?php echo $GLOBALS['lang']->get('all_fields');?>');
|
||||
}
|
||||
else {
|
||||
$('#msg').html('<div class="spinner-container"><svg class="spinner" style="width:41px;height:40px;" viewBox="0 0 44 44"><circle class="path" cx="22" cy="22" r="20" fill="none" stroke-width="4"></circle> </svg> </div>');
|
||||
</div>
|
||||
</div>
|
||||
<h1><?php echo $lang->get('login'); ?></h1>
|
||||
<form action="<?php echo $MCONF['web_uri']; ?>admin/login.php" method="post"
|
||||
id="login">
|
||||
<input type="text" placeholder="<?php echo $lang->get('username'); ?>" id="username"
|
||||
autofocus/><br/>
|
||||
<input type="password" placeholder="<?php echo $lang->get('password'); ?>"
|
||||
id="pw"/><br/>
|
||||
<div id="2faContainer" style="display: none">
|
||||
<input type="text" id="2fa" autocomplete="off"
|
||||
placeholder="<?php echo $lang->get('2fa_code'); ?>"><br/>
|
||||
</div>
|
||||
<a href="reset-pw.php"><?php echo $lang->get('reset_pass_lost');?></a><br/>
|
||||
<input type="submit" value="<?php echo $lang->get('login'); ?>"/>
|
||||
</form>
|
||||
<div id="msg"></div>
|
||||
</div>
|
||||
<p style="text-align: center;color: #fff;text-shadow: 1px 1px 1px #555;">© 2016 <a
|
||||
href="http://mowie.cc" style="color: #fff;">Mowie</a></p>
|
||||
</div>
|
||||
<script>
|
||||
$("#login").submit(function () {
|
||||
if ($('#username').val() == '' || $('#pw').val() == '') {
|
||||
$('#msg').html('<?php echo $lang->get('all_fields');?>');
|
||||
}
|
||||
else {
|
||||
$('#msg').html('<div class="spinner-container"><svg class="spinner" style="width:41px;height:40px;" viewBox="0 0 44 44"><circle class="path" cx="22" cy="22" r="20" fill="none" stroke-width="4"></circle> </svg> </div>');
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '<?php echo $GLOBALS['MCONF']['web_uri']; ?>admin/login.php',
|
||||
data: "username=" + $('#username').val() + "&pw=" + $('#pw').val() + "&2fa=" + $('#2fa').val(),
|
||||
success: function (msg) {
|
||||
console.log(msg);
|
||||
if (msg == 'success') {
|
||||
location.reload();
|
||||
}
|
||||
else if (msg == '2fa') {
|
||||
$('#2faContainer').show();
|
||||
$('#msg').hide();
|
||||
}
|
||||
else if (msg == '2fafail') {
|
||||
$('#msg').html('<div class="message-fail"><?php echo $GLOBALS['lang']->get('error_2fa');?></div>');
|
||||
}
|
||||
else {
|
||||
$('#msg').html('<div class="message-fail"><?php echo $GLOBALS['lang']->get('wrong_username_or_pass');?></div>');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '<?php echo $MCONF['web_uri']; ?>admin/login.php',
|
||||
data: "username=" + $('#username').val() + "&pw=" + $('#pw').val() + "&2fa=" + $('#2fa').val(),
|
||||
success: function (msg) {
|
||||
console.log(msg);
|
||||
if (msg == 'success') {
|
||||
location.reload();
|
||||
}
|
||||
else if (msg == '2fa') {
|
||||
$('#2faContainer').show();
|
||||
$('#msg').hide();
|
||||
}
|
||||
else if (msg == '2fafail') {
|
||||
$('#msg').html('<div class="message-fail"><?php echo $lang->get('error_2fa');?></div>');
|
||||
}
|
||||
else {
|
||||
$('#msg').html('<div class="message-fail"><?php echo $lang->get('wrong_username_or_pass');?></div>');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
//Change current Language
|
||||
$('#langselectbtn').click(function () {
|
||||
$('.langs').fadeToggle(100);
|
||||
});
|
||||
//Change current Language
|
||||
$('#langselectbtn').click(function () {
|
||||
$('.langs').fadeToggle(100);
|
||||
});
|
||||
|
||||
function changeLang(lang) {
|
||||
$('#msg').html('<div class="spinner-container"><svg class="spinner" style="width:41px;height:40px;" viewBox="0 0 44 44"><circle class="path" cx="22" cy="22" r="20" fill="none" stroke-width="4"></circle> </svg> </div>');
|
||||
$.get('<?php echo $GLOBALS['MCONF']['home_uri'];?>admin/lang.php?set=' + lang, function (data) {
|
||||
console.log(data);
|
||||
if (data == 1) {
|
||||
location.reload();
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html><?php
|
||||
function changeLang(lang) {
|
||||
$('#msg').html('<div class="spinner-container"><svg class="spinner" style="width:41px;height:40px;" viewBox="0 0 44 44"><circle class="path" cx="22" cy="22" r="20" fill="none" stroke-width="4"></circle> </svg> </div>');
|
||||
$.get('<?php echo $MCONF['home_uri'];?>admin/lang.php?set=' + lang, function (data) {
|
||||
console.log(data);
|
||||
if (data == 1) {
|
||||
location.reload();
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html><?php
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
|
71
index.php
71
index.php
|
@ -36,47 +36,52 @@ if (file_exists('inc/config.yml'))
|
|||
foreach ($apps->getApps() as $app => $appconf)
|
||||
{
|
||||
$appUri = 'apps/' . $app . '/';
|
||||
//If the App should run from one domain only
|
||||
if ((isset($appconf['domain']) && $page->getDomain() == $appconf['domain']) || !isset($appconf['domain']) || (isset($appconf['domain']) && $appconf['domain'] === ''))
|
||||
|
||||
//Check App dependencies
|
||||
if($apps->checkDependencies($appconf['app_name']))
|
||||
{
|
||||
//If we have an alias which equals the current url, execute it
|
||||
if (isset($appconf['alias']))
|
||||
//If the App should run from one domain only
|
||||
if ((isset($appconf['domain']) && $page->getDomain() == $appconf['domain']) || !isset($appconf['domain']) || (isset($appconf['domain']) && $appconf['domain'] === ''))
|
||||
{
|
||||
if (array_key_exists($page->getUrl(), $appconf['alias']))
|
||||
//If we have an alias which equals the current url, execute it
|
||||
if (isset($appconf['alias']))
|
||||
{
|
||||
require $appUri . $appconf['alias'][$page->getUrl()];
|
||||
}
|
||||
}
|
||||
|
||||
//If we have a type
|
||||
if (isset($appconf['type']))
|
||||
{
|
||||
//Page for (more or less) dynamic content
|
||||
if ($appconf['type'] == 'page')
|
||||
{
|
||||
//If we have a base_url_file and the current url equals base_url, execute base_url_file
|
||||
if (isset($appconf['base_url_file']))
|
||||
if (array_key_exists($page->getUrl(), $appconf['alias']))
|
||||
{
|
||||
if ($appconf['base_url'] == $page->getUrl())
|
||||
{
|
||||
require $appUri . $appconf['base_url_file'];
|
||||
}
|
||||
}
|
||||
|
||||
//if we have a base_url and a base_file which exists and the current baseUrl equals base_url, execute base_file
|
||||
if (isset($appconf['base_url']) && file_exists($appUri . '/' . $appconf['base_file']))
|
||||
{
|
||||
if ($appconf['base_url'] == $page->getBaseUrl())
|
||||
{
|
||||
require $appUri . $appconf['base_file'];
|
||||
}
|
||||
require $appUri . $appconf['alias'][$page->getUrl()];
|
||||
}
|
||||
}
|
||||
|
||||
//Static
|
||||
if ($appconf['type'] == 'static' && isset($appconf['base_file']) && file_exists($appUri . '/' . $appconf['base_file']))
|
||||
//If we have a type
|
||||
if (isset($appconf['type']))
|
||||
{
|
||||
require $appUri . $appconf['base_file'];
|
||||
//Page for (more or less) dynamic content
|
||||
if ($appconf['type'] == 'page')
|
||||
{
|
||||
//If we have a base_url_file and the current url equals base_url, execute base_url_file
|
||||
if (isset($appconf['base_url_file']))
|
||||
{
|
||||
if ($appconf['base_url'] == $page->getUrl())
|
||||
{
|
||||
require $appUri . $appconf['base_url_file'];
|
||||
}
|
||||
}
|
||||
|
||||
//if we have a base_url and a base_file which exists and the current baseUrl equals base_url, execute base_file
|
||||
if (isset($appconf['base_url']) && file_exists($appUri . '/' . $appconf['base_file']))
|
||||
{
|
||||
if ($appconf['base_url'] == $page->getBaseUrl())
|
||||
{
|
||||
require $appUri . $appconf['base_file'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Static
|
||||
if ($appconf['type'] == 'static' && isset($appconf['base_file']) && file_exists($appUri . '/' . $appconf['base_file']))
|
||||
{
|
||||
require $appUri . $appconf['base_file'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue