/** * Display template with standard header and footer */ function tpl_display_show($template, $flush = true) { smarty_display('header.tpl'); if ($flush) { flush(); } smarty_display($template); smarty_display('footer.tpl'); }
/* Check User rights */ checkMinGroup(2); /* Edit */ $edit_suffix = null; if (isset($_GET['do']) && $_GET['do'] == 'edit' && ($id = $_GET['id'])) { $edit_suffix = c2r_get_emailsuffix($id); } /* Update */ if (isset($_POST['do']) && $_POST['do'] == 'update') { c2r_update_emailsuffix($_POST['id'], $_POST['suffix'], $_POST['location_id']); addInfoMessage($_POST['suffix'] . ' updated!'); } /* Delete */ if (isset($_GET['do']) && $_GET['do'] == 'delete' && ($id = $_GET['id'])) { c2r_delete_emailsuffix($id); addInfoMessage('Email suffix deleted!'); } /* Insert */ if (isset($_POST['do']) && $_POST['do'] == 'insert') { c2r_insert_emailsuffix($_POST['suffix'], $_POST['location_id']); addInfoMessage('New email suffix inserted!'); } $company_id = $user->group_id == 3 ? 0 : $user->company_id; $emailsuffixes = c2r_get_emailsuffixes($company_id); $locations = c2r_locations_get(0, $company_id); #print_r($locations); $smarty->assign('edit_suffix', $edit_suffix); $smarty->assign('emailsuffixes', $emailsuffixes); $smarty->assign('locations', $locations); smarty_display('emailsuffix');
} } // Submit if (!$_GET['rid']) { $rid = $_POST['rid']; c2r_routepoints_delete($rid); $pos = 0; for ($i = 0; $i < 10; $i++) { if (!$_POST['delete_' . $i]) { $pos++; $pid = $_POST['point'][$i]; $st = $_POST['steptime'][$i]; c2r_routepoints_insert($rid, $pid, $st, $pos); } } addInfoMessage('Route Points saved!'); // Reload route $route = c2r_routes_get($rid); } $rps = c2r_route_points_get($rid); if ($_GET['my']) { $smarty->assign('my', true); } $smarty->assign('rid', $rid); $smarty->assign('rps', $rps); $smarty->assign('locations', $locations); $smarty->assign('location', $location); $smarty->assign('route', $route); #$smarty->assign('company', $company); smarty_display('route_points');
<?php /* Standard include */ require_once '../functions/functions.php'; /* Check User rights */ checkMinGroup(1); if ($user->group_id == 2) { $filter = $user->company_id; } else { $filter = null; } $request_uid = $user->id; if ($_GET['all'] == 1) { $request_uid = 0; } $status = $_GET['status']; if ($close_id = $_GET['close_id']) { c2r_close_single_offer($close_id); addInfoMessage(t('Your offer was closed')); } $offers = c2r_offers_get($request_uid, $status, 0, $filter); // only open offers not in the past // Sort by earliest start date usort($offers, 'sort_offers'); $smarty->assign('offers', $offers); $smarty->assign('status', $status); $smarty->assign('all', $_GET['all']); smarty_display('offers');
if ($user->group_id < 3) { $cid_for_loc = $user->company_id; } $locations = c2r_locations_get(0, $cid_for_loc); $bool_to_activate = false; foreach ($uns as $key => $un) { if ($un->is_active) { continue; } $bool_to_activate = true; } // Add Message to change Password if (isset($_GET['cp'])) { addInfoMessage('Please change your Password.'); } // Add Message to change Password if (isset($_GET['registered'])) { addInfoMessage(t('You are now registered.')); addInfoMessage(t('Please change your password now!')); addInfoMessage(t('Please check your default location and change it if needed.')); } $smarty->assign('user', $user); $smarty->assign('ui', $ui); $smarty->assign('uid', $uid); $smarty->assign('uns', $uns); $smarty->assign('locations', $locations); $smarty->assign('admin_view', $admin_view); $smarty->assign('bool_to_activate', $bool_to_activate); $smarty->assign('companies', $companies); smarty_display('profile');
$title = $result[0]['title']; $mail = $lang['msg_borrowaskmail']; $subject = $lang['msg_borrowasksubject']; $url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']) . '/show.php?id=' . $id; // replace place holders $mail = str_replace('%id%', $id, $mail); $mail = str_replace('%diskid%', $diskid, $mail); $mail = str_replace('%owner%', $owner, $mail); $mail = str_replace('%ownermail%', $owner_email, $mail); $mail = str_replace('%user%', $user, $mail); $mail = str_replace('%usermail%', $user_email, $mail); $mail = str_replace('%title%', $title, $mail); $mail = str_replace('%url%', $url, $mail); $subject = str_replace('%id%', $id, $subject); $subject = str_replace('%diskid%', $diskid, $subject); $subject = str_replace('%owner%', $owner, $subject); $subject = str_replace('%ownermail%', $owner_email, $subject); $subject = str_replace('%user%', $user, $subject); $subject = str_replace('%usermail%', $user_email, $subject); $subject = str_replace('%title%', $title, $subject); $subject = str_replace('%url%', $url, $subject); // prepare templates tpl_page(); /* $smarty->assign('success', @mail($owner_email, $subject, $mail)); Fix for https://sourceforge.net/tracker/?func=detail&atid=586362&aid=1570618&group_id=88349 */ $smarty->assign('success', @mail($owner_email, $subject, $mail, "From: {$user} <{$user_email}>\r\nReply-To: {$user_email}\r\n")); // display templates smarty_display('borrowask.tpl');
<?php /* Open CarPool is a free and open source carpooling/dynamic ride sharing system, open to be connected to other car pools and public transport. Copyright (C) 2009-2014 Oliver Pintat, Clemens Rath This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. In case this software interacts with other software tools, other licenses may apply. */ require_once '../functions/functions.php'; require_once '../functions/gravatar.php'; smarty_display('index');
case 'imdb': // imdb $smarty->assign('searchaka', $searchaka); if (!empty($find)) { $result = engineSearch($find, $engine, $searchaka); $searchurl = engineGetSearchUrl($find, $engine); } break; default: // tvcom, amazon, google if (!empty($find)) { $result = engineSearch($find, $engine); $searchurl = engineGetSearchUrl($find, $engine); } } $smarty->assign('searchtype', $searchtype); $smarty->assign('imdbresults', $result); // process asynchronous refresh if ($ajax_render) { ajax_render(); } // prepare templates tpl_language(); tpl_header(); // prepare template with selected and available engines tpl_lookup($find, $engine, $searchtype); $smarty->assign('searchurl', $searchurl); $smarty->assign('http_error', $CLIENTERROR); // display templates smarty_display('lookup.tpl');
<?php require_once '../functions/functions.php'; checkMinGroup(1); if (isset($_GET['close_id']) && ($close_id = $_GET['close_id'])) { c2r_close_single_request($close_id); addInfoMessage(t('Your request was closed')); } if (isset($_GET['action']) && $_GET['action'] == 'accept_offer') { c2r_accept_offer($_GET['driver_id'], $_GET['offer_id'], $_GET['phone_number']); addInfoMessage(t('Anjenommen')); } $requests = c2r_requests_get($user->id, 'open', 0); // Sort by earliest start date usort($requests, 'sort_requests'); $smarty->assign('requests', $requests); smarty_display('matchingoffers');
$name = $_POST['name']; $lid = $_POST['lid_e']; $geo = $_POST['geo_e']; $key = $_POST['key']; c2r_pickuppoints_update($pid, $name, $lid, $geo, $key); addInfoMessage(t('Pick-up point ') . $name . t(' updated')); } /* Delete Pickuppoint */ if (isset($_GET['do']) && $_GET['do'] == 'delete') { $pid = $_GET['pid']; c2r_pickuppoints_delete($pid); } /* Edit company */ if (isset($_GET['do']) && $_GET['do'] == 'edit') { $edit_pid = $_GET['pid']; } $cid_for_loc = 0; if ($user->group_id < 3) { $cid_for_loc = $user->company_id; } $locations = c2r_locations_get(0, $cid_for_loc); $cid_for_pp = 0; if ($user->group_id < 3) { $cid_for_pp = $user->company_id; } $pickuppoints = c2r_pickuppoints_get(0, 0, $cid_for_pp); $smarty->assign('edit_pid', $edit_pid); $smarty->assign('pickuppoints', $pickuppoints); $smarty->assign('locations', $locations); smarty_display('pickuppoints');
<?php /** * Movie Trailers View * * Shows available youtube trailers * * @package videoDB * @author Andreas Goetz <*****@*****.**> * @version $Id: trailer.php,v 1.4 2009/04/04 16:25:58 andig2 Exp $ */ require_once './core/functions.php'; require_once './engines/youtube.php'; // decode entities to care for numeric html escapes of JS single quotes $trailer = youtubeSearch(html_entity_decode_all($title)); // prepare templates tpl_language(); tpl_header(); $smarty->assign('trailer', $trailer); // display templates smarty_display('trailer.tpl');
<?php require_once '../functions/functions.php'; checkMinGroup(1); if ($close_id = $_GET['close_id']) { c2r_close_single_offer($close_id); addInfoMessage(t('Your offer was closed')); } $offers = c2r_offers_get($user->id, 'open', 0); // Sort by earliest start date usort($offers, 'sort_offers'); $smarty->assign('offers', $offers); smarty_display('matchingrequests');
<?php /* Standard include */ require_once '../functions/functions.php'; /* Check User rights */ checkMinGroup(1); /* get all locations */ $locations = c2r_locations_own(); /* Update default location */ if ($dlid = $_POST['dlid']) { c2r_user_update_default_location($user->id, $dlid); addInfoMessage(t('updated your location')); getUser(); // refresh user } /* Display */ $smarty->assign('locations', $locations); smarty_display('defaultlocation');
$name = $_POST['name']; $smskey = $_POST['smskey']; $zendeskid = $_POST['zendeskid']; $logourl = $_POST['logourl']; $email = $_POST['email']; $cid = $_POST['cid']; $edit_cid = $cid; c2r_companies_update($cid, $name, $smskey, $zendeskid, $logourl, $email); addInfoMessage("Company {$name} updated"); } /* Delete company */ if (isset($_GET['do']) && $_GET['do'] == 'delete') { $cid = $_GET['cid']; c2r_companies_delete($cid); addInfoMessage("Company deleted"); } /* Edit company */ if (isset($_GET['do']) && $_GET['do'] == 'edit') { $edit_cid = $_GET['cid']; // just edit own if not an (super?) admin if ($bycompany && $companies[$edit_cid]->id != $user->company_id) { checkMinGroup(0); } } /* Reload */ $companies = c2r_companies_get(); $smarty->assign('bycompany', $bycompany); $smarty->assign('edit_cid', $edit_cid); $smarty->assign('companies', $companies); smarty_display('companies');
<?php /* Standard include */ require_once '../functions/functions.php'; /* Check User rights */ checkMinGroup(1); $lid = $user->default_location_id; $routes = c2r_routes_get(0, $lid, 0, true); $smarty->assign('routes', $routes); smarty_display('allroutes');
<?php require_once '../functions/functions.php'; if ($user->id && in_array($user->id, $ocp_allowed_user_for_translation)) { # access allowed } else { checkMinGroup(3); } if (is_array($_POST) && count($_POST)) { foreach ($_POST as $k => $v) { if (preg_match('#translation_(\\d+)#', $k, $matches)) { $id = $matches[1]; updateTranslation($id, $v); } } addInfoMessage('Translations updated.'); } $translations = getAllTranslations($user->ui->language); $smarty->assign('translations', $translations); smarty_display('translations');
} } if (!$has_errors) { c2r_userinfo_insert($_POST['name'], $_POST['email'], $_POST['cid'], $_POST['dlid'], $_POST['gid'], $_POST['is_active'], $_POST['number']); unset($_POST); } else { if ($duplicate_email) { $e_msg = 'Duplicate Email: ' . $_POST['email']; addErrorMessage($e_msg); c2r_log_error('Add User', $e_msg); } if ($duplicate_number) { $e_msg = 'Duplicate Numbers: ' . $_POST['number']; addErrorMessage($e_msg); c2r_log_error('Add User', $e_msg); } } } $users = c2r_users_get($user->group_id < 3 ? $user->company_id : 0); foreach ($users as $uid => $u) { $ui = c2r_get_user_info_object($uid); $users[$uid]->ui = $ui; } $locations = c2r_locations_get(0, $user->group_id < 3 ? $user->company_id : 0); $companies = c2r_companies_get(); $smarty->assign('companies', $companies); $smarty->assign('locations', $locations); $smarty->assign('has_errors', $has_errors); $smarty->assign('users', $users); smarty_display('users');
<?php require_once '../functions/functions.php'; smarty_display('feedback');
<?php require_once '../functions/functions.php'; checkMinGroup(2); $companies = c2r_companies_get(); $smarty->assign('companies', $companies); smarty_display('configuration');
<?php /* Standard include */ require_once '../functions/functions.php'; /* Check User rights */ checkMinGroup(1); if ($user->group_id == 2) { $filter = $user->company_id; } else { $filter = null; } $request_uid = $user->id; $all = isset($_GET['all']) ? $_GET['all'] : ''; if ($all == 1) { $request_uid = 0; } $status = $_GET['status']; if (isset($_GET['close_id']) && ($close_id = $_GET['close_id'])) { c2r_close_single_request($close_id); addInfoMessage('Your request was closed!'); } $requests = c2r_requests_get($request_uid, $status, 0, $filter); // only requsts not in the past // Sort by earliest start date usort($requests, 'sort_requests'); $smarty->assign('requests', $requests); $smarty->assign('status', $status); $smarty->assign('all', $all); smarty_display('requests');
$err_code_text = $t_error_code; } else { // registered Succesfully; header("Location: " . OCP_BASE_URL . "profile.php?registered=1"); /* Redirect browser */ exit; } } } } $smarty->assign('display', $display); $smarty->assign('disclaimer', $disclaimer); $smarty->assign('t_intro', $t_intro); $smarty->assign('t_error', $t_error); $smarty->assign('t_name', $t_name); $smarty->assign('t_email', $t_email); $smarty->assign('t_phone', $t_phone); $smarty->assign('t_submit', $t_submit); $smarty->assign('err_name_text', $err_name_text); $smarty->assign('err_email_text', $err_email_text); $smarty->assign('err_phone_text', $err_phone_text); $smarty->assign('err_code_text', $err_code_text); $smarty->assign('t_thankyou', str_replace("%email%", $email, $t_thankyou)); $smarty->assign('t_entercode', $t_entercode); $smarty->assign('t_entercode2', $t_entercode2); $smarty->assign('t_confirmcode', $t_confirmcode); $smarty->assign('t_finish', $t_finish); $smarty->assign('t_error_code', $t_error_code); $smarty->assign('code', $code); smarty_display('register');
<?php /* Standard include */ require_once '../functions/functions.php'; /* Check User rights */ checkMinGroup(1); smarty_display('driver');
$timezone = $_POST['timezone']; $phone = $_POST['phone']; if ($user->group_id < 3) { if ($cid != $user->company_id) { die('You can\'t update a location for this company!'); } } c2r_locations_update($lid, $lname, $cid, $timezone, $phone); addInfoMessage('Location updated.'); $locations = c2r_locations_get(0, $cid_for_loc); } /* Delete company */ if (isset($_GET['do']) && $_GET['do'] == 'delete') { $lid = $_GET['lid']; if ($user->group_id < 3) { if ($locations[$lid]->cid != $user->company_id) { die('You can\'t delete a location for this company!'); } } c2r_locations_delete($lid); $locations = c2r_locations_get(0, $cid_for_loc); } /* Edit company */ if (isset($_GET['do']) && $_GET['do'] == 'edit') { $edit_lid = $_GET['lid']; } $smarty->assign('edit_lid', $edit_lid); $smarty->assign('locations', $locations); $smarty->assign('companies', $companies); smarty_display('locations');
function smarty_displayPageWithSkin($templateName) { $skin = session_getSkin(); smarty_assign('contentTemplateName', "{$skin}/{$templateName}"); smarty_display(); }
$user_id = $user->id; } $status = $_POST['status']; c2r_routes_update($rid, $origin, $destination, $status, $key, $lid, $user_id); } /* Delete Route */ if (isset($_GET['do']) && $_GET['do'] == 'delete') { $rid = $_GET['rid']; c2r_routes_delete($rid); } /* Edit company */ if (isset($_GET['do']) && $_GET['do'] == 'edit') { $edit_rid = $_GET['rid']; } $cid_for_loc = 0; if ($user->group_id < 3) { $cid_for_loc = $user->company_id; } $locations = c2r_locations_get(0, $cid_for_loc); $cid_for_routes = 0; if ($user->group_id < 3) { $cid_for_routes = $user->company_id; } $routes = c2r_routes_get(0, 0, $myroutes ? $user->id : 0, false, $cid_for_routes); $smarty->assign('myroutes', $myroutes); $smarty->assign('edit_rid', $edit_rid); $smarty->assign('user_id', $user_id); $smarty->assign('locations', $locations); $smarty->assign('routes', $routes); smarty_display('routes');
/* PW Lost */ if ($key = $_GET['pwlost']) { check_lost_password($key); // if script continues, then key was invalid addErrorMessage(t('This key is invalid, please use the password lost function again')); } /* Login */ if (isset($_POST['email'])) { $email = strtolower($_POST['email']); $password = $_POST['password']; if (!loginUser($email, $password)) { addErrorMessage(t('Wrong email address or password')); } } /* Password lost */ if (isset($_POST['lost_email'])) { $email = strtolower($_POST['lost_email']); $keeponpage = true; $res = c2r_lost_password($email); if ($res == 1) { addInfoMessage(t('We sent you a login link via email. Please check your email account.')); } else { addErrorMessage(t('Unknown email address. You can register a new account with this email address.')); } } if (!$keeponpage && $user) { header('Location: ' . OCP_BASE_URL); exit; } smarty_display(t('login'));
// allow XML export if (isset($q)) { $link = htmlentities($_SERVER['QUERY_STRING']); // encode for XHTML compliance if ($link) { $link .= '&'; } $link = 'search.php?' . $link; if ($config['xls']) { $smarty->assign('xls', $link); } if ($config['xml']) { $smarty->assign('xml', $link); } if ($config['pdf']) { $smarty->assign('pdf', $link); } } if ($config['multiuser']) { $smarty->assign('owners', out_owners(array($all => $all), PERM_READ)); $smarty->assign('owner', $owner); } // display templates smarty_display('header.tpl'); if (!$config['http_caching']) { flush(); } smarty_display('search.tpl'); smarty_display('list.tpl'); smarty_display('footer.tpl');
<?php /* Standard include */ require_once '../functions/functions.php'; /* Check User rights */ checkMinGroup(1); smarty_display('passenger');
<?php require_once '../functions/functions.php'; /* only show wall monitor if user is logged in * (we don't know for which company to display offers otherwise) */ if (!$user->group_id) { header("Location: /index.php"); } else { smarty_display('wallmonitor'); }
if ($key = $_GET['pwlost']) { check_lost_password($key); // if script continues, then key was invalid addErrorMessage(t('This key is invalid, please use the password lost function again')); } /* Login */ if (isset($_POST['email'])) { $email = $_POST['email']; $password = $_POST['password']; if (!loginUser($email, $password)) { addErrorMessage(t('Wrong email address or password')); } } /* Password lost */ if (isset($_POST['lost_email'])) { $email = $_POST['lost_email']; $keeponpage = true; $res = c2r_lost_password($email); if ($res == 1) { addInfoMessage(t('We sent you a login link via email. Please check your email account.')); } else { addErrorMessage(t('Unknown email address. You can register a new account with this email address.')); } } if (!$keeponpage && $user) { header(t('Location: ') . OCP_BASE_URL); exit; } /* template determination */ smarty_display('lostpassword');