function login_error($msg) { global $smarty; $smarty->assign('error_msg', $msg); $smarty->assign('email', htmlspecialchars(@$_POST['email'])); login_main(); }
/** * ChurchTools 2.0 * http://www.churchtools.de * * Copyright (c) 2014 Jens Martin Rauen * Licensed under the MIT license, located in LICENSE.txt * * ChurchCal Module * Depends on ChurchCore */ function churchcal_main() { global $config, $base_url, $config, $embedded; drupal_add_css(ASSETS . '/fullcalendar/fullcalendar.css'); if (isset($_GET["printview"])) { drupal_add_css(ASSETS . '/fullcalendar/fullcalendar.print.css'); } drupal_add_css(ASSETS . '/simplecolorpicker/jquery.simplecolorpicker.css'); drupal_add_js(ASSETS . '/simplecolorpicker/jquery.simplecolorpicker.js'); drupal_add_js(ASSETS . '/fullcalendar/moment.min.js'); drupal_add_js(ASSETS . '/fullcalendar/fullcalendar.min.js'); drupal_add_js(CHURCHCORE . '/cc_events.js'); drupal_add_js(CHURCHCORE . '/cc_abstractview.js'); drupal_add_js(CHURCHCORE . '/cc_standardview.js'); drupal_add_js(CHURCHCORE . '/cc_maintainstandardview.js'); drupal_add_js(CHURCHCAL . '/eventview.js'); drupal_add_js(CHURCHCAL . '/yearview.js'); drupal_add_js(CHURCHCAL . '/calendar.js'); drupal_add_js(CHURCHCAL . '/cal_sources.js'); drupal_add_js(createI18nFile("churchcore")); drupal_add_js(createI18nFile("churchcal")); $txt = ''; if ($catId = getVar("category_id")) { include_once CHURCHCAL . '/churchcal_db.php'; $auth = churchcal_getAuthForAjax(); $perm = true; foreach (explode(",", $catId) as $id) { // Check permission, perhaps show login mask if (empty($auth["view category"]) || empty($auth["view category"][$id])) { $perm = false; } } if (!$perm) { include_once MAIN . '/login.php'; $login = login_main(); if (!userLoggedIn()) { return $login; } } $txt .= '<input type="hidden" id="filtercategory_id" name="category_id" value="' . $catId . '"/>' . NL; if ($id = getVar("id")) { // only of category_id is set $txt .= '<input type="hidden" id="filterevent_id" name="id" value="' . $id . '"/>' . NL; } } if (getVar("printview")) { $txt .= '<input type="hidden" id="printview" value="true"/>'; $embedded = true; } if ($embedded) { if ($catSel = getVar("category_select")) { $txt .= '<input type="hidden" id="filtercategory_select" name="category_select" value="' . $catSel . '"/>' . NL; } if ($cssUrl = getVar("cssurl")) { drupal_add_css($cssUrl); } // if (getConf("churchcal_css", "-") != "-") $txt .= '<style>' . getConf("churchcal_css") . '</style>'; //TODO: is // the '-' important? if ($css = getConf("churchcal_css")) { $txt .= "<style>{$css}</style>" . NL; } if (getVar("minical")) { $txt .= '<input type="hidden" id="isminical"/>'; } $txt .= ' <div class="row-fluid"> <div id="cdb_filter"></div> </div> <div id="cdb_content"><div id="calendar"></div></div> '; if (getVar("embedded")) { $txt .= '<input type="hidden" id="isembedded"/>'; } if ($t = getVar("title")) { $txt .= '<input type="hidden" id="embeddedtitle" value="' . $t . '"/>'; } if ($e = getVar("entries")) { $txt .= '<input type="hidden" id="entries" value="' . $e . '"/>'; } if ($s = getVar("startdate")) { $txt .= '<input type="hidden" id="init_startdate" value="' . $s . '"/>'; } if ($e = getVar("enddate")) { $txt .= '<input type="hidden" id="init_enddate" value="' . $e . '"/>'; } } else { $txt .= ' <div class="row-fluid"> <div class="span3"><div id="cdb_filter"></div></div> <div class="span9"><div id="header" class="pull-right"></div><div id="cdb_content"><div id="calendar"></div></div></div> <p align=right><small> <a target="_blank" href="' . $base_url . '?q=churchcal&embedded=true"> ' . t("embed", getConf("churchcal_name")) . '</a> <a target="_clean" href="http://intern.churchtools.de/?q=churchwiki#WikiView/filterWikicategory_id:0/doc:ChurchCal%C2%A0einbetten/"><i class="icon-question-sign"></i></a> <a id="abo" href="' . $base_url . '?q=churchcal/ical">' . $config["churchcal_name"] . ' ' . t("subscribe.to.ical") . '</a>' . '</small>'; } if ($d = getVar("date")) { $txt .= '<input type="hidden" name="viewdate" id="viewdate" value="' . $d . '"/>'; } if ($v = getVar("viewname")) { $txt .= '<input type="hidden" name="viewname" id="viewname" value="' . $v . '"/>'; } return $txt; }
$status = 'Error!'; $msg = 'Login information not specified.'; return; } if (empty($_POST['login-email']) or empty($_POST['login-password'])) { $status = 'Error!'; $msg = 'Login information not specified.'; return; } $email_address = $_POST['login-email']; $password = $_POST['login-password']; if (user\authenticate_user($email_address, $password)) { $status = 'Logged In!'; $msg = 'You have successfully logged in to Easy Ride!'; } else { $status = 'Invalid Credentials!'; $msg = 'You have specified an invalid combination of email address and password.'; } } login_main(); include_once '../templates/head.php'; ?> <div class="well ds-component ds-hover container-narrow" data-componentid="well1"> <div class="ds-component ds-hover" data-componentid="content2"> <?php functions\html_respond($status, $msg); ?> </div> </div> <?php include '../templates/footer.php';