cacert-webdb/www/advertising.php
2006-12-09 14:26:30 +00:00

84 lines
2.3 KiB
PHP

<? /*
Copyright (C) 2004 by Duane Groth <duane_at_CAcert_dot_org>
This file is part of CAcert.
CAcert has been released under the CAcert Source License
which can be found included with these source files or can
be downloaded from the internet from the following address:
http://www.cacert.org/src-lic.php
CAcert is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the License for more details.
*/ ?>
<?
if($_SESSION['profile']['adadmin'] <= 0)
{
showheader(_("My CAcert.org Account!"));
echo _("You don't have access to this area.");
showfooter();
exit;
}
$id = intval($_REQUEST['id']);
if($id == 2)
$id = 0;
$oldid = intval($_POST['oldid']);
$process = $_POST['process'];
loadem("account");
$errmsg = "";
if($oldid == 1 && $process != "")
{
$title = mysql_real_escape_string(strip_tags(trim(htmlentities($_POST['title']))));
$link = mysql_real_escape_string(strip_tags(trim($_POST['link'])));
$months = intval($_POST['months']);
if(!strstr($link, "://"))
{
$link = "http://".$link;
}
if($months < 1 || $months > 12)
{
$id = 1;
$errmsg .= _("You can only place an advertisement for up to 12 months.<br />");
unset($process);
unset($oldid);
}
if(strlen($title) <= 5)
{
$id = 1;
$errmsg .= _("Link title was too short.<br />");
unset($process);
unset($oldid);
}
if(strlen($link) <= 10)
{
$id = 1;
$errmsg .= _("Link URI was too short.<br />");
unset($process);
unset($oldid);
}
}
if($oldid == 1 && $process != "")
{
$query = "insert into `advertising` set `link`='$link', `title`='$title', `months`='$months', `who`='".$_SESSION['profile']['id']."',
`when`=NOW()";
mysql_query($query);
unset($link);
unset($title);
unset($months);
$id = 1;
$errmsg = _("Your advertisement request has been lodge in the system and administrators notified. Once the information has been reviewed, you will be notified if the link was acceptable or declined and the reason for the decline. If the request is successful the system will generate an invoice.");
}
showheader(_("CAcert.org Advertising Section"));
includeit($id, "advertising");
showfooter();
?>