Commit 9b9273a7 authored by changi67's avatar changi67

[MOD] Identation + Copyright

parent 6c7290fc
<?php
// $Header$
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// (c) Copyright 2002-2009 by authors of the Tiki Wiki/CMS/Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
//session_start();
// hmm. to many session tweaks in setup_smarty ... we need to call this
require_once('tiki-setup.php');
require_once ('tiki-setup.php');
if ($prefs['feature_antibot'] != 'y' && $prefs['rnd_num_reg'] != 'y') {
die;
}
//random_number.php
$img_number = imagecreate(95, 30);
$white = imagecolorallocate($img_number, 255, 255, 255);
$black = imagecolorallocate($img_number, 0, 0, 0);
$grey_shade = imagecolorallocate($img_number, 204, 204, 204);
imagefill($img_number, 0, 0, $grey_shade);
srand (time());
srand(time());
$number = get_random();
$_SESSION['random_number'] = $number;
for ($i = 0; $i < 5; $i++) {
Imagestring($img_number, 5, 10 + 17 * $i + rand(0, 2), 1 + rand(0, 10), substr($number, $i, 1), $black);
}
header ("Content-type: image/jpeg");
imagejpeg ($img_number);
header("Content-type: image/jpeg");
imagejpeg($img_number);
function get_random() {
# return a 5 digit value
// return a 5 digit value
return rand(10000, 99999);
}
This diff is collapsed.
<?php
// $Id: /cvsroot/tikiwiki/tiki/tiki-received_articles.php,v 1.26.2.1 2007-11-26 14:41:03 sylvieg Exp $
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// (c) Copyright 2002-2009 by authors of the Tiki Wiki/CMS/Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// Initialization
// $Id: /cvsroot/tikiwiki/tiki/tiki-received_articles.php,v 1.26.2.1 2007-11-26 14:41:03 sylvieg Exp $
require_once ('tiki-setup.php');
include_once ('lib/commcenter/commlib.php');
include_once ('lib/articles/artlib.php');
if ($prefs['feature_comm'] != 'y') {
$smarty->assign('msg', tra("This feature is disabled").": feature_comm");
$smarty->assign('msg', tra("This feature is disabled") . ": feature_comm");
$smarty->display("error.tpl");
die;
}
if ($tiki_p_admin_received_articles != 'y') {
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra("You do not have permission to use this feature"));
$smarty->display("error.tpl");
die;
}
if (!isset($_REQUEST["receivedArticleId"])) {
$_REQUEST["receivedArticleId"] = 0;
}
$smarty->assign('receivedArticleId', $_REQUEST["receivedArticleId"]);
if ($_REQUEST["receivedArticleId"]) {
$info = $commlib->get_received_article($_REQUEST["receivedArticleId"]);
$info["topic"] = 1;
} else {
$info = array();
$info["title"] = '';
$info["authorName"] = '';
$info["size"] = 0;
......@@ -51,7 +39,7 @@ if ($_REQUEST["receivedArticleId"]) {
$info["image_data"] = '';
$info["publishDate"] = $tikilib->now;
$cur_time = explode(',', $tikilib->date_format('%Y,%m,%d,%H,%M,%S', $publishDate));
$info["expireDate"] = $tikilib->make_time($cur_time[3], $cur_time[4], $cur_time[5], $cur_time[1], $cur_time[2], $cur_time[0]+1);
$info["expireDate"] = $tikilib->make_time($cur_time[3], $cur_time[4], $cur_time[5], $cur_time[1], $cur_time[2], $cur_time[0] + 1);
$info["created"] = $tikilib->now;
$info["heading"] = '';
$info["body"] = '';
......@@ -61,42 +49,28 @@ if ($_REQUEST["receivedArticleId"]) {
$info["type"] = 'Article';
$info["rating"] = 5;
}
$smarty->assign('view', 'n');
if (isset($_REQUEST["view"])) {
$info = $tikilib->get_received_article($_REQUEST["view"]);
$smarty->assign('view', 'y');
$info["topic"] = 1;
}
if (isset($_REQUEST["accept"])) {
check_ticket('received-articles');
// CODE TO ACCEPT A PAGE HERE
$publishDate = $tikilib->make_time($_REQUEST["Time_Hour"], $_REQUEST["Time_Minute"],
0, $_REQUEST["Date_Month"], $_REQUEST["Date_Day"], $_REQUEST["Date_Year"]);
$expireDate = $tikilib->make_time($_REQUEST["expire_Hour"], $_REQUEST["expire_Minute"],
0, $_REQUEST["expire_Month"], $_REQUEST["expire_Day"], $_REQUEST["expire_Year"]);
$commlib->update_received_article($_REQUEST["receivedArticleId"], $_REQUEST["title"], $_REQUEST["authorName"],
$_REQUEST["useImage"], $_REQUEST["image_x"], $_REQUEST["image_y"],
$publishDate, $expireDate, $_REQUEST["heading"], $_REQUEST["body"], $_REQUEST["type"], $_REQUEST["rating"]);
$publishDate = $tikilib->make_time($_REQUEST["Time_Hour"], $_REQUEST["Time_Minute"], 0, $_REQUEST["Date_Month"], $_REQUEST["Date_Day"], $_REQUEST["Date_Year"]);
$expireDate = $tikilib->make_time($_REQUEST["expire_Hour"], $_REQUEST["expire_Minute"], 0, $_REQUEST["expire_Month"], $_REQUEST["expire_Day"], $_REQUEST["expire_Year"]);
$commlib->update_received_article($_REQUEST["receivedArticleId"], $_REQUEST["title"], $_REQUEST["authorName"], $_REQUEST["useImage"], $_REQUEST["image_x"], $_REQUEST["image_y"], $publishDate, $expireDate, $_REQUEST["heading"], $_REQUEST["body"], $_REQUEST["type"], $_REQUEST["rating"]);
$commlib->accept_article($_REQUEST["receivedArticleId"], $_REQUEST["topic"]);
$smarty->assign('preview', 'n');
$smarty->assign('receivedArticleId', 0);
}
$smarty->assign('preview', 'n');
$smarty->assign('topic', $info["topic"]);
if (isset($_REQUEST["preview"])) {
$smarty->assign('preview', 'y');
$info["publishDate"] = $tikilib->make_time($_REQUEST["Time_Hour"], $_REQUEST["Time_Minute"],
0, $_REQUEST["Date_Month"], $_REQUEST["Date_Day"], $_REQUEST["Date_Year"]);
$info["expireDate"] = $tikilib->make_time($_REQUEST["expire_Hour"], $_REQUEST["expire_Minute"],
0, $_REQUEST["expire_Month"], $_REQUEST["expire_Day"], $_REQUEST["expire_Year"]);
$info["publishDate"] = $tikilib->make_time($_REQUEST["Time_Hour"], $_REQUEST["Time_Minute"], 0, $_REQUEST["Date_Month"], $_REQUEST["Date_Day"], $_REQUEST["Date_Year"]);
$info["expireDate"] = $tikilib->make_time($_REQUEST["expire_Hour"], $_REQUEST["expire_Minute"], 0, $_REQUEST["expire_Month"], $_REQUEST["expire_Day"], $_REQUEST["expire_Year"]);
$info["title"] = $_REQUEST["title"];
$info["authorName"] = $_REQUEST["authorName"];
$info["receivedArticleId"] = $_REQUEST["receivedArticleId"];
......@@ -112,7 +86,6 @@ if (isset($_REQUEST["preview"])) {
$info["type"] = $_REQUEST["type"];
$info["rating"] = $_REQUEST["rating"];
}
$smarty->assign('topic', $info["topic"]);
$smarty->assign('title', $info["title"]);
$smarty->assign('authorName', $info["authorName"]);
......@@ -128,30 +101,23 @@ $smarty->assign('heading', $info["heading"]);
$smarty->assign('body', $info["body"]);
$smarty->assign('type', $info["type"]);
$smarty->assign('rating', $info["rating"]);
// Assign parsed
$smarty->assign('parsed_heading', $tikilib->parse_data($info["heading"]));
$smarty->assign('parsed_body', $tikilib->parse_data($info["body"]));
if (isset($_REQUEST["remove"])) {
$area = 'delreceivedarticle';
if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) {
key_check($area);
$area = 'delreceivedarticle';
if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) {
key_check($area);
$commlib->remove_received_article($_REQUEST["remove"]);
} else {
key_get($area);
}
} else {
key_get($area);
}
}
if (isset($_REQUEST["save"])) {
check_ticket('received-articles');
$publishDate = $tikilib->make_time($_REQUEST["Time_Hour"], $_REQUEST["Time_Minute"],
0, $_REQUEST["Date_Month"], $_REQUEST["Date_Day"], $_REQUEST["Date_Year"]);
$expireDate = $tikilib->make_time($_REQUEST["expire_Hour"], $_REQUEST["expire_Minute"],
0, $_REQUEST["Date_Month"], $_REQUEST["Date_Day"], $_REQUEST["Date_Year"]);
$commlib->update_received_article($_REQUEST["receivedArticleId"], $_REQUEST["title"], $_REQUEST["authorName"],
$_REQUEST["useImage"], $_REQUEST["image_x"], $_REQUEST["image_y"], $publishDate, $expireDate, $_REQUEST["heading"], $_REQUEST["body"]);
$publishDate = $tikilib->make_time($_REQUEST["Time_Hour"], $_REQUEST["Time_Minute"], 0, $_REQUEST["Date_Month"], $_REQUEST["Date_Day"], $_REQUEST["Date_Year"]);
$expireDate = $tikilib->make_time($_REQUEST["expire_Hour"], $_REQUEST["expire_Minute"], 0, $_REQUEST["Date_Month"], $_REQUEST["Date_Day"], $_REQUEST["Date_Year"]);
$commlib->update_received_article($_REQUEST["receivedArticleId"], $_REQUEST["title"], $_REQUEST["authorName"], $_REQUEST["useImage"], $_REQUEST["image_x"], $_REQUEST["image_y"], $publishDate, $expireDate, $_REQUEST["heading"], $_REQUEST["body"]);
$smarty->assign('receivedArticleId', $_REQUEST["receivedArticleId"]);
$smarty->assign('title', $_REQUEST["title"]);
$smarty->assign('authorName', $_REQUEST["authorName"]);
......@@ -164,44 +130,32 @@ if (isset($_REQUEST["save"])) {
$smarty->assign('heading', $_REQUEST["heading"]);
$smarty->assign('body', $_REQUEST["body"]);
}
if (!isset($_REQUEST["sort_mode"])) {
$sort_mode = 'receivedDate_desc';
} else {
$sort_mode = $_REQUEST["sort_mode"];
}
if (!isset($_REQUEST["offset"])) {
$offset = 0;
} else {
$offset = $_REQUEST["offset"];
}
$smarty->assign_by_ref('offset', $offset);
if (isset($_REQUEST["find"])) {
$find = $_REQUEST["find"];
} else {
$find = '';
}
$smarty->assign('find', $find);
$smarty->assign_by_ref('sort_mode', $sort_mode);
$channels = $commlib->list_received_articles($offset, $maxRecords, $sort_mode, $find);
$smarty->assign_by_ref('channels', $channels["data"]);
$smarty->assign_by_ref('cant', $channels["cant"]);
$topics = $artlib->list_topics();
$smarty->assign_by_ref('topics', $topics);
$types = $artlib->list_types();
$smarty->assign_by_ref('types', $types);
ask_ticket('received-articles');
// Display the template
$smarty->assign('mid', 'tiki-received_articles.tpl');
$smarty->display("tiki.tpl");
<?php
// $Id: /cvsroot/tikiwiki/tiki/tiki-received_pages.php,v 1.18.2.1 2007-10-24 13:51:07 sylvieg Exp $
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// (c) Copyright 2002-2009 by authors of the Tiki Wiki/CMS/Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// Initialization
// $Id: /cvsroot/tikiwiki/tiki/tiki-received_pages.php,v 1.18.2.1 2007-10-24 13:51:07 sylvieg Exp $
require_once ('tiki-setup.php');
include_once ('lib/commcenter/commlib.php');
include_once ('lib/wiki/wikilib.php');
$auto_query_args = array('receivedPageId', 'sort_mode', 'offset', 'find', 'sort_modes');
if ($prefs['feature_comm'] != 'y') {
$smarty->assign('msg', tra("This feature is disabled").": feature_comm");
$smarty->assign('msg', tra("This feature is disabled") . ": feature_comm");
$smarty->display("error.tpl");
die;
}
if ($tiki_p_admin_received_pages != 'y') {
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra("You do not have permission to use this feature"));
$smarty->display("error.tpl");
die;
}
if (!isset($_REQUEST["receivedPageId"])) {
$_REQUEST["receivedPageId"] = 0;
}
$smarty->assign('receivedPageId', $_REQUEST["receivedPageId"]);
$errors = array();
if (isset($_REQUEST["accept"])) {
check_ticket('received-pages');
// CODE TO ACCEPT A PAGE HERE
if (!$commlib->accept_page($_REQUEST["accept"])) {
$info = $commlib->get_received_page($_REQUEST['accept']);
$errors[] = array('error'=>'Page already exists');
$errors[] = array('error' => 'Page already exists');
}
}
if ($_REQUEST["receivedPageId"]) {
$info = $commlib->get_received_page($_REQUEST["receivedPageId"]);
} else {
$info = array();
$info["pageName"] = '';
$info["data"] = '';
$info["comment"] = '';
}
$smarty->assign('view', 'n');
if (isset($_REQUEST["view"])) {
$info = $commlib->get_received_page($_REQUEST["view"]);
$smarty->assign('view', 'y');
}
if (isset($_REQUEST["preview"])) {
$info["pageName"] = $_REQUEST["pageName"];
$info["data"] = $_REQUEST["data"];
$info["comment"] = $_REQUEST["comment"];
}
$smarty->assign('pageName', $info["pageName"]);
$smarty->assign('data', $info["data"]);
$smarty->assign('comment', $info["comment"]);
// Assign parsed
$smarty->assign('parsed', $tikilib->parse_data($info["data"]));
if (isset($_REQUEST["remove"])) {
$area = 'delreceivedpage';
if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) {
key_check($area);
$area = 'delreceivedpage';
if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) {
key_check($area);
$commlib->remove_received_page($_REQUEST["remove"]);
} else {
key_get($area);
}
} else {
key_get($area);
}
}
if (isset($_REQUEST["save"])) {
check_ticket('received-pages');
$commlib->update_received_page($_REQUEST["receivedPageId"], $_REQUEST["pageName"], $_REQUEST["data"], $_REQUEST["comment"]);
$smarty->assign('pageName', $_REQUEST["pageName"]);
$smarty->assign('data', $_REQUEST["data"]);
$smarty->assign('comment', $_REQUEST["comment"]);
$smarty->assign('receivedPageId', 0);
$smarty->assign('parsed', $tikilib->parse_data($_REQUEST["data"]));
}
if (!empty($_REQUEST['checked']) && (!empty($_REQUEST['prefix']) || !empty($_REQUEST['postfix']))) {
check_ticket('received-pages');
foreach ($_REQUEST['checked'] as $page) {
$newpage = empty($_REQUEST['postfix'])? $_REQUEST['prefix'].$page: $page.$_REQUEST['postfix'];
foreach($_REQUEST['checked'] as $page) {
$newpage = empty($_REQUEST['postfix']) ? $_REQUEST['prefix'] . $page : $page . $_REQUEST['postfix'];
if ($tikilib->page_exists($newpage)) {
$errors[] = array('error'=>'Page already exists', 'param'=>$page);
$errors[] = array('error' => 'Page already exists', 'param' => $page);
}
}
if (empty($errors)) {
$commlib->rename_structure_pages($_REQUEST['checked'], isset($_REQUEST['prefix'])?$_REQUEST['prefix']: '', isset($_REQUEST['postfix'])?$_REQUEST['postfix']: '');
$commlib->rename_structure_pages($_REQUEST['checked'], isset($_REQUEST['prefix']) ? $_REQUEST['prefix'] : '', isset($_REQUEST['postfix']) ? $_REQUEST['postfix'] : '');
}
}
if (!isset($_REQUEST["sort_mode"])) {
$sort_mode = 'receivedDate_desc';
} else {
$sort_mode = $_REQUEST["sort_mode"];
}
if (!isset($_REQUEST["offset"])) {
$offset = 0;
} else {
$offset = $_REQUEST["offset"];
}
$smarty->assign_by_ref('offset', $offset);
if (isset($_REQUEST["find"])) {
$find = $_REQUEST["find"];
} else {
$find = '';
}
$smarty->assign('find', $find);
$smarty->assign_by_ref('sort_mode', $sort_mode);
$channels = $tikilib->list_received_pages($offset, $maxRecords, $sort_mode, $find, 'p');
$smarty->assign_by_ref('channels', $channels["data"]);
$smarty->assign_by_ref('cant', $channels['cant']);
if (!isset($_REQUEST['sort_modes'])) {
$sort_modes = 'receivedDate_desc';
} else {
......@@ -145,13 +113,10 @@ if (!isset($_REQUEST['sort_modes'])) {
}
$structures = $tikilib->list_received_pages(0, -1, $sort_modes, $find, 's');
$smarty->assign_by_ref('structures', $structures['data']);
if (!empty($errors)) {
$smarty->assign_by_ref('errors', $errors);
}
ask_ticket('received-pages');
// Display the template
$smarty->assign('mid', 'tiki-received_pages.tpl');
$smarty->display("tiki.tpl");
<?php
// $Id: /cvsroot/tikiwiki/tiki/tiki-referer_stats.php,v 1.15 2007-10-12 07:55:32 nyloth Exp $
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// (c) Copyright 2002-2009 by authors of the Tiki Wiki/CMS/Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// Initialization
// $Id: /cvsroot/tikiwiki/tiki/tiki-referer_stats.php,v 1.15 2007-10-12 07:55:32 nyloth Exp $
require_once ('tiki-setup.php');
include_once ('lib/refererstats/refererlib.php');
if ($prefs['feature_referer_stats'] != 'y') {
$smarty->assign('msg', tra("This feature is disabled").": feature_referer_stats");
$smarty->assign('msg', tra("This feature is disabled") . ": feature_referer_stats");
$smarty->display("error.tpl");
die;
}
if ($tiki_p_view_referer_stats != 'y') {
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra("You do not have permission to use this feature"));
$smarty->display("error.tpl");
die;
}
if (isset($_REQUEST["clear"])) {
$area = 'delrefstats';
if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) {
key_check($area);
$area = 'delrefstats';
if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) {
key_check($area);
$refererlib->clear_referer_stats();
} else {
key_get($area);
}
} else {
key_get($area);
}
}
if (!isset($_REQUEST["sort_mode"])) {
$sort_mode = 'hits_desc';
} else {
$sort_mode = $_REQUEST["sort_mode"];
}
if (!isset($_REQUEST["offset"])) {
$offset = 0;
} else {
$offset = $_REQUEST["offset"];
}
$smarty->assign_by_ref('offset', $offset);
if (isset($_REQUEST["find"])) {
$find = $_REQUEST["find"];
} else {
$find = '';
}
$smarty->assign('find', $find);
$smarty->assign_by_ref('sort_mode', $sort_mode);
$channels = $refererlib->list_referer_stats($offset, $maxRecords, $sort_mode, $find);
$smarty->assign_by_ref('cant_pages', $channels["cant"]);
$smarty->assign_by_ref('channels', $channels["data"]);
ask_ticket('referer-stats');
// Display the template
$smarty->assign('mid', 'tiki-referer_stats.tpl');
$smarty->display("tiki.tpl");
This diff is collapsed.
<?php
require_once('tiki-setup.php');
require_once('lib/ajax/ajaxlib.php');
// (c) Copyright 2002-2009 by authors of the Tiki Wiki/CMS/Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
require_once ('tiki-setup.php');
require_once ('lib/ajax/ajaxlib.php');
function AJAXCheckUserName($name) {
global $userlib;
$objResponse = new xajaxResponse();
if (empty($name)) {
$objResponse->addAssign("checkfield", "innerHTML", tra("empty"));
} else if ($userlib->user_exists($name)) {
$objResponse->addAssign("checkfield", "innerHTML", tra('User already exists'));
} else {
$objResponse->addAssign("checkfield", "innerHTML", tra('Valid').' '.tra('user'));
$objResponse->addAssign("checkfield", "innerHTML", tra('Valid') . ' ' . tra('user'));
}
return $objResponse;
}
function AJAXCheckMail($mail) {
$objResponse = new xajaxResponse();
if (empty($mail)) {
$objResponse->addAssign("checkmail", "innerHTML", tra("empty"));
} else if (!eregi("^[_a-z0-9\.\-]+@[_a-z0-9\.\-]+\.[a-z]{2,4}$", $mail)) {
$objResponse->addAssign("checkmail", "innerHTML", tra('This is not a valid mail adress'));
} else {
$objResponse->addAssign("checkmail", "innerHTML", tra('Valid').' '.tra('mail adress'));
$objResponse->addAssign("checkmail", "innerHTML", tra('Valid') . ' ' . tra('mail adress'));
}
return $objResponse;
}
// xajax
$ajaxlib->setRequestURI('tiki-register_ajax.php');
$ajaxlib->registerFunction('AJAXCheckUserName');
......
<?php
// Initialization
require_once('tiki-setup.php');
// (c) Copyright 2002-2009 by authors of the Tiki Wiki/CMS/Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
require_once ('tiki-setup.php');
if ($tiki_p_admin != 'y') {
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra("You do not have permission to use this feature"));
$smarty->display("error.tpl");
die;
}
include_once('lib/directory/dirlib.php');
include_once ('lib/directory/dirlib.php');
$tmp1 = isset($_SERVER["SERVER_NAME"]) ? $_SERVER["SERVER_NAME"] : "";
$tmp2 = isset($_SERVER["PHP_SELF"]) ? $_SERVER["PHP_SELF"] : "";
// concat all, remove the // between server and path and then
// remove the name of the script itself:
$url = $tmp1.dirname($tmp2);
$url = $tmp1 . dirname($tmp2);
$info = Array();
$info["name"] = $prefs['browsertitle'];
$info["description"] = '';
$info["url"] = $url;
$info["country"] = 'None';
$info["isValid"] = 'n';
$smarty->assign_by_ref('info',$info);
$smarty->assign_by_ref('info', $info);
$countries = $tikilib->get_flags();
$smarty->assign_by_ref('countries',$countries);
$smarty->assign_by_ref('countries', $countries);
// Display the template
$smarty->assign('mid','tiki-register_site.tpl');
$smarty->assign('mid', 'tiki-register_site.tpl');
$smarty->display("tiki.tpl");
<?php
// $Id: /cvsroot/tikiwiki/tiki/tiki-remind_password.php,v 1.34.2.1 2008-01-16 13:48:10 sylvieg Exp $
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// (c) Copyright 2002-2009 by authors of the Tiki Wiki/CMS/Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// Initialization
// $Id: /cvsroot/tikiwiki/tiki/tiki-remind_password.php,v 1.34.2.1 2008-01-16 13:48:10 sylvieg Exp $
require_once ('tiki-setup.php');
if ($prefs['forgotPass'] != 'y') {
$smarty->assign('msg', tra("This feature is disabled").": forgotPass");
$smarty->assign('msg', tra("This feature is disabled") . ": forgotPass");
$smarty->display("error.tpl");
die;
}
$smarty->assign('showmsg', 'n');
$smarty->assign('showfrm', 'y');
$isvalid = false;
if (isset($_REQUEST["user"])) {
// this is a 'new password activation':
if (isset($_REQUEST["actpass"])) {
$oldPass = $userlib->activate_password($_REQUEST["user"], $_REQUEST["actpass"]);
if ($oldPass) {
header ("location: tiki-change_password.php?user=". urlencode($_REQUEST["user"])."&oldpass=".$oldPass);
header("location: tiki-change_password.php?user=" . urlencode($_REQUEST["user"]) . "&oldpass=" . $oldPass);
die;
}
$smarty->assign('msg', tra("Invalid username or activation code. Maybe this code has already been used."));
......@@ -32,12 +26,11 @@ if (isset($_REQUEST["user"])) {
die;
}
}
if (isset($_REQUEST["remind"])) {
if (!empty($_REQUEST['name'])) {
if (!$userlib->user_exists($_REQUEST['name'])) {
$showmsg = 'e';
$smarty->assign('msg', tra('Invalid or unknown username'). ': ' . $_REQUEST['name']);
$smarty->assign('msg', tra('Invalid or unknown username') . ': ' . $_REQUEST['name']);
} else {
$info = $userlib->get_user_info($_REQUEST["name"]);
if (!empty($info['valid']) && ($prefs['validateRegistration'] == 'y' || $prefs['validateUsers'] == 'y')) {
......@@ -53,7 +46,7 @@ if (isset($_REQUEST["remind"])) {
} else if (!empty($_REQUEST['email'])) {
if (!($_REQUEST['name'] = $userlib->get_user_by_email($_REQUEST['email']))) {
$showmsg = 'e';
$smarty->assign('msg', tra('Invalid or unknown email'). ': ' . $_REQUEST['email']);
$smarty->assign('msg', tra('Invalid or unknown email') . ': ' . $_REQUEST['email']);
}
} else {
$showmsg = 'e';
......@@ -70,54 +63,44 @@ if (isset($_REQUEST["remind"])) {
$pass = $userlib->renew_user_password($name);
$smarty->assign('clearpw', 'n');
}
$languageEmail = $tikilib->get_user_preference($name, "language", $prefs['site_language']);
// Now check if the user should be notified by email
$foo = parse_url($_SERVER["REQUEST_URI"]);
$machine = $tikilib->httpPrefix(). dirname($foo["path"]);
$machine = $tikilib->httpPrefix() . dirname($foo["path"]);
$machine = preg_replace("!/$!", "", $machine); // just incase
$smarty->assign('mail_machine', $machine);
$smarty->assign('mail_site', $_SERVER["SERVER_NAME"]);
$smarty->assign('mail_user', $name);
$smarty->assign('mail_same', $prefs['feature_clear_passwords']);
$smarty->assign('mail_pass', $pass);
$smarty->assign('mail_apass', md5($pass));
$smarty->assign('mail_ip', $tikilib->get_ip_address());
$mail_data = sprintf($smarty->fetchLang($languageEmail, 'mail/password_reminder_subject.tpl'),$_SERVER["SERVER_NAME"]);
$mail_data = sprintf($smarty->fetchLang($languageEmail, 'mail/password_reminder_subject.tpl'), $_SERVER["SERVER_NAME"]);
$mail = new TikiMail($name);
$mail->setSubject(sprintf($mail_data, $_SERVER["SERVER_NAME"]));
$mail->setText($smarty->fetchLang($languageEmail, 'mail/password_reminder.tpl'));
if (!$mail->send(array($_REQUEST['email']))) {
$smarty->assign('msg', tra("The mail can't be sent. Contact the administrator"));
$smarty->display("error.tpl");
die;
$smarty->display("error.tpl");
die;