Initial checkin

This commit is contained in:
genuineparts 2025-06-20 19:10:23 +02:00
commit d75eb444fc
4304 changed files with 369634 additions and 0 deletions

View file

@ -0,0 +1,44 @@
<?php
class module_contact extends admin_module{
function admin_panels(){
#$panels=array(array("add_text","Text hinzuf&uuml;gen","page_add"),array("edit_text","Text editieren","page_edit"),array("group_only","Textkategorien"),array("addcategory_text","Kategorie hinzuf&uuml;gen","tag_blue_add"),array("editcategory_text","Kategorie editieren","tag_blue_edit"));
return $panels;
}
function get_info(){
$info["name"]="Kontaktformular";
$info["file"]="contact";
$info["author"]="astat";
$info["version"]="1.0.0";
$info["url"]="http://www.astat.org";
return $info;
}
function install(){
global $config, $db;
$db->query("INSERT INTO `" . $config["prefix"] . "config_categorys` (
`cid` ,
`categoryname`
)
VALUES (
NULL , 'Kontaktformular'
);");
$cid=$db->last_id();
$db->query("INSERT INTO `" . $config["prefix"] . "config` (`name`, `value`, `title`, `description`, `option`, `category`) VALUES
('contact_email', 'contact@example.com', 'E-Mailadresse', 'Die E-Mailadresse(n) an die Kontaktanfragen gesendet werden sollen (meherer Adressen mit Komma trennen).', 'text', ".$cid."),
('contact_captcha', '1', 'Captcha verwenden?', 'Soll bei der Kontaktaufnahme ein Captcha angezeigt werden?', 'yesno', ".$cid.");");
return TRUE;
}
function uninstall(){
global $config, $db;
$db->query("DELETE FROM `" . $config["prefix"] . "config_categorys` WHERE categoryname='Kontaktformular'");
$db->query("DELETE FROM `" . $config["prefix"] . "config` WHERE name in ('contact_email','contact_captcha')");
return TRUE;
}
}
?>

View file

@ -0,0 +1,76 @@
<?php
/**
* Project: astat - simple site engine
* File: /modules/contact/contact.output.php
*
* 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; version 2 of the License.
*
* 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 Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @link http://www.astat.org SVN: $URL$
* @copyright 2009 becast.at
* @author Bernhard Jaud <bernhard at becast dot at>
* @package astat core
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
*/
If (!defined("in_astat")) {
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
}
$session->page_begin("Contactform", FALSE);
class contact extends module{
function output(){
global $module,$config,$db,$log,$core,$error;
$emsg=FALSE;
if(isset($_POST['submit'])){
if(!isset($_POST['name']) || $_POST['name']==""){
$emsg.='<span style="color:red; font-weight:bold">Du musst deinen Namen eingeben!</span><br />';
}elseif(!isset($_POST['email']) || $_POST['email']==""){
$emsg.='<span style="color:red; font-weight:bold">Du musst deine E-Mailadresse eingeben!</span><br />';
}elseif(!isset($_POST['subject']) || $_POST['subject']==""){
$emsg.='<span style="color:red; font-weight:bold">Du musst einen Betreff eingeben!</span><br />';
}elseif(!isset($_POST['message']) || $_POST['message']==""){
$emsg.='<span style="color:red; font-weight:bold">Du musst eine Nachricht eingeben!</span><br />';
}
if(!preg_match("/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.(([0-9]{1,3})|([a-zA-Z]{2,3})|(aero|coop|info|museum|name))$/",$_POST['email'])){
$emsg.='<span style="color:red; font-weight:bold">Deine E-Mail ist ung&uuml;ltig!</span><br />';
}
if($config['contact_captcha']==1){
include ('thirdparty/securimage/securimage.php');
$img = new Securimage();
if(!$img->check($_POST['captcha'])){
$emsg.='<span style="color:red; font-weight:bold">Das CAPTCHA ist ung&uuml;ltig!</span><br />';
}
}
if(!$emsg){
$mail=new mail();
$mail->set_header("From",$config["sitetitle"]." <".$config["siteemail"].">");
$this->tpl->assign('post',$_POST);
$this->tpl->assign("sitename",$config["sitetitle"]);
$mailbody=$this->tpl->fetch('contact_mail.tpl');
$mail->bodytext($mailbody);
$mail->sendmail($config["contact_email"],"Kontakt von ".$_POST["name"]);
$core->message("Danke","Deine Nachricht wurde versendet.<br />Wir werden so schnell wie m&ouml;glich Kontakt mit Dir aufnehmen.",TRUE,$config["path"]."/index.php",3);
}
}
$this->tpl->assign('post',$_POST);
$this->tpl->assign('emsg',$emsg);
$this->tpl->assign('captcha',$config['contact_captcha']);
$this->tpl->assign('sid',md5(uniqid(time())));
return $this->tpl->fetch('contactform.tpl', 'contactform');
}
}
?>