diff --git a/admin/addgroup.apnl.php b/admin/addgroup.apnl.php index c5948fb..c697dd5 100644 --- a/admin/addgroup.apnl.php +++ b/admin/addgroup.apnl.php @@ -1,4 +1,4 @@ - * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: b6de49df98d4050265bddcd2e10ea51f57c7d06a $ */ If (!defined("IN_BCWE_ADMIN")) { @@ -53,100 +53,27 @@ class addgroup_panel extends admin_module{ } }else{ - $result = $db->query("SELECT * FROM " . $config["prefix"] . "role_values"); - $panel->title="Gruppe anlegen"; - $panel->content='Hier kann man Benutzergruppen anlegen.'; - $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=addgroup")); - $panel->content.="

Gruppename:

"; - $panel->field(array("name"=>"name","typ"=>"text","value"=>$data["name"])); - $panel->content.="

"; - $panel->content.=" - - - "; - while ($row = $db->fetch_array($result)){ - $panel->content.=""; - } - $panel->content.="
Rechte
".$row["text"].":
".$this->get_option($row["type"],$row["id"])."

"; - $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); - $panel->content.="
"; - $panel->submit(); - $panel->formClose(); + $result = $db->query("SELECT * FROM " . $config["prefix"] . "role_values"); + $panel->title="Gruppe anlegen"; + $panel->content='Hier kann man Benutzergruppen anlegen.'; + $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=addgroup")); + $panel->content.="

Gruppename:

"; + $panel->field(array("name"=>"name","typ"=>"text","value"=>"")); + $panel->content.="

"; + $panel->content.=" + + + "; + while ($row = $db->fetch_array($result)){ + $panel->content.=""; + } + $panel->content.="
Rechte
".$row["text"].":
".$panel->get_option($row["type"],$row["id"])."

"; + $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); + $panel->content.="
"; + $panel->submit(); + $panel->formClose(); } } - function get_option($option,$name) { - global $config,$db,$panel,$userinfo,$admin,$root,$firephp; - - if($option=="yesno"){ - $checked["yes"]=""; - $checked["no"]=""; - $yn=$panel->radio(array("name"=>$name,"value"=>"1"),NULL,TRUE); - $yn.="Ja"; - $yn.=$panel->radio(array("name"=>$name,"value"=>"0"),NULL,TRUE); - $yn.="Nein"; - return $yn; - } - if($option=="onoff"){ - $checked["on"]=""; - $checked["off"]=""; - $yn=$panel->radio(array("name"=>$name,"value"=>"1"),NULL,TRUE); - $yn.="An"; - $yn.=$panel->radio(array("name"=>$name,"value"=>"0"),NULL,TRUE); - $yn.="Aus"; - return $yn; - } - - if($option=="text"){ - $text=$panel->field(array("name"=>$name,"typ"=>"text"),"",TRUE); - return $text; - } - - if(strstr($option,"wysiwyg")){ - $string=str_replace("wysiwyg(","",substr($option, 0, -1)); - $sarr=explode(";",$string); - foreach($sarr as $str){ - $substr=explode("|",$str); - $a_name[]=$substr[0]; - $value[]=$substr[1]; - } - if(is_array($sarr)){ - $text=$panel->textarea(array("name"=>$name, $a_name[0]=>$value[0],$a_name[1]=>$value[1]),"class=\"mceEditor\"",TRUE); - }else{ - $text=$panel->textarea(array("name"=>$name),"class=\"mceEditor\"",TRUE); - } - return $text; - } - - if(strstr($option,"textarea")){ - $string=str_replace("textarea(","",substr($option, 0, -1)); - $sarr=explode(";",$string); - foreach($sarr as $str){ - $substr=explode("|",$str); - $a_name[]=$substr[0]; - $value[]=$substr[1]; - } - if(is_array($sarr)){ - $text=$panel->textarea(array("name"=>$name, $a_name[0]=>$value[0],$a_name[1]=>$value[1]),"",TRUE); - }else{ - $text=$panel->textarea(array("name"=>$name),"",TRUE); - } - return $text; - } - - if(strstr($option,"select")){ - //$text=$panel->field("text",$name,"value=\"".$config[$name]."\"",TRUE); - $string=str_replace("select(","",substr($option, 0, -1)); - $sarr=explode(";",$string); - foreach($sarr as $str){ - $substr=explode("|",$str); - $values[$substr[0]]=$substr[1]; - } - $select=$panel->select($values,NULL,$name,"",TRUE); - return $select; - } - - } - } ?> \ No newline at end of file diff --git a/admin/adduser.apnl.php b/admin/adduser.apnl.php index 220835b..c9b8efa 100644 --- a/admin/adduser.apnl.php +++ b/admin/adduser.apnl.php @@ -22,7 +22,7 @@ * @author Bernhard Jaud * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: 220835b018d365f1e1cc18303854a8f657d49831 $ */ If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); diff --git a/admin/banips.apnl.php b/admin/banips.apnl.php index df3253c..34a2e87 100644 --- a/admin/banips.apnl.php +++ b/admin/banips.apnl.php @@ -1,4 +1,4 @@ - * @package astat core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: 25cfe5d1f82f94b9aaf583a537432b5fbbf49cfd $ */ If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); @@ -40,7 +40,7 @@ class banips_panel extends admin_module{ $db->query("INSERT INTO `" . $config["prefix"] . "banned_ips` (`ip`,`date`,`reason`) VALUES ('".$db->escape($_POST['ip'])."','".time()."','".$db->escape($_POST["reason"])."')"); $panel->admin_message($lang->_('SUCCESS'),$lang->_('DATASAVED'),True,"banips",3); } - }elseif($_GET["action"]=='delete' && $_GET['id']){ + }elseif(isset($_GET['action']) && $_GET["action"]=='delete' && $_GET['id']){ $db->query("DELETE FROM `" . $config["prefix"] . "banned_ips` WHERE `id`='".intval($_GET['id'])."'"); $panel->admin_message("Ban lifted","The ban was lifted.",True,"banips",3); }else{ @@ -54,27 +54,27 @@ class banips_panel extends admin_module{ $ips[]=$row; } $panel->title=$lang->_('BANNEDIPS'); - $panel->content.=" + $panel->content.="
- - - - - + + + + + "; if(!empty($ips)){ foreach($ips as $i){ $panel->content.=" - - - - "; - $panel->content.=" + + + + "; + $panel->content.=""; } }else{ $panel->content.=" - + "; } $panel->content.="
".$lang->_('ID')."".$lang->_('IP')."".$lang->_('DATE')."".$lang->_('REASON')."".$lang->_('ACTION')."".$lang->_('ID')."".$lang->_('IP')."".$lang->_('DATE')."".$lang->_('REASON')."".$lang->_('ACTION')."
".$i['id']."".$i['ip']."".date('d.m.Y, H:i',$i['date'])."".$i['reason']."".$i['id']."".$i['ip']."".date('d.m.Y, H:i',$i['date'])."".$i['reason']."
".$lang->_('NOBANNEDIPS')."".$lang->_('NOBANNEDIPS')."

"; diff --git a/admin/config.apnl.php b/admin/config.apnl.php index a944f6c..57bffc9 100644 --- a/admin/config.apnl.php +++ b/admin/config.apnl.php @@ -1,4 +1,4 @@ - * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: 46136c7b3c8b92ef759a6cae6baa72c7332ee3ff $ */ If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); @@ -60,7 +60,7 @@ class config_panel extends admin_module{ $panel->content.="

".$key."

"; foreach($val as $v){ - $panel->content.=""; + $panel->content.=""; } $panel->content.="
".$v["title"]."
".$v["description"]."
".$this->get_option($v["option"],$v["name"])."
".$v["title"]."
".$v["description"]."
".$panel->get_option($v["option"],$v["name"],$config[$v["name"]])."
"; @@ -74,99 +74,6 @@ class config_panel extends admin_module{ //bottomAccordion.activate($$(\'vertical_container .accordion_toggle\')[0]); '; } - - function get_option($option,$name) { - global $config,$db,$panel,$userinfo,$admin,$root,$firephp,$lang; - - if($option=="yesno"){ - $checked["yes"]=""; - $checked["no"]=""; - if($config[$name]==1||$config[$name]==True||$config[$name]=="yes"){ - $checked["yes"]='checked="checked"'; - }else{ - $checked["no"]='checked="checked"'; - } - $yn=$panel->radio(array("name"=>$name,"value"=>"1"),$checked["yes"],TRUE); - $yn.="Ja"; - $yn.=$panel->radio(array("name"=>$name,"value"=>"0"),$checked["no"],TRUE); - $yn.="Nein"; - return $yn; - } - if($option=="onoff"){ - $checked["on"]=""; - $checked["off"]=""; - if($config[$name]==1||$config[$name]==True||$config[$name]=="on"){ - $checked["on"]='checked="checked"'; - }else{ - $checked["off"]='checked="checked"'; - } - $yn=$panel->radio(array("name"=>$name,"value"=>"1"),$checked["on"],TRUE); - $yn.="An"; - $yn.=$panel->radio(array("name"=>$name,"value"=>"0"),$checked["off"],TRUE); - $yn.="Aus"; - return $yn; - } - - if($option=="language"){ - $langs=$lang->getlanguages(); - foreach($langs as $lang){ - $values[$lang['name']]=$lang['short']; - } - $select=$panel->select($values,$config[$name],$name,"",TRUE); - return $select; - } - - if($option=="text"){ - $text=$panel->field(array("name"=>$name,"typ"=>"text","value"=>$config[$name]),"",TRUE); - return $text; - } - - if(strstr($option,"wysiwyg")){ - $string=str_replace("wysiwyg(","",substr($option, 0, -1)); - $sarr=explode(";",$string); - foreach($sarr as $str){ - $substr=explode("|",$str); - $a_name[]=$substr[0]; - $value[]=$substr[1]; - } - if(is_array($sarr)){ - $text=$panel->textarea(array("name"=>$name,"value"=>$config[$name], $a_name[0]=>$value[0],$a_name[1]=>$value[1]),"class=\"mceEditor\"",TRUE); - }else{ - $text=$panel->textarea(array("name"=>$name,"value"=>$config[$name]),"class=\"mceEditor\"",TRUE); - } - return $text; - } - - if(strstr($option,"textarea")){ - $string=str_replace("textarea(","",substr($option, 0, -1)); - $sarr=explode(";",$string); - foreach($sarr as $str){ - $substr=explode("|",$str); - $a_name[]=$substr[0]; - $value[]=$substr[1]; - } - if(is_array($sarr)){ - $text=$panel->textarea(array("name"=>$name,"value"=>$config[$name], $a_name[0]=>$value[0],$a_name[1]=>$value[1]),"",TRUE); - }else{ - $text=$panel->textarea(array("name"=>$name,"value"=>$config[$name]),"",TRUE); - } - return $text; - } - - if(strstr($option,"select")){ - //$text=$panel->field("text",$name,"value=\"".$config[$name]."\"",TRUE); - $string=str_replace("select(","",substr($option, 0, -1)); - $sarr=explode(";",$string); - foreach($sarr as $str){ - $substr=explode("|",$str); - $values[$substr[0]]=$substr[1]; - } - $select=$panel->select($values,$config[$name],$name,"",TRUE); - return $select; - } - - } - function meta() { global $module,$config,$db,$panel,$userinfo,$admin,$root; $meta=' diff --git a/admin/editgroup.apnl.php b/admin/editgroup.apnl.php index 0642d1a..90f1871 100644 --- a/admin/editgroup.apnl.php +++ b/admin/editgroup.apnl.php @@ -1,4 +1,4 @@ - * @package astat core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: 10c6f8d62584734ff49092f4b041ec253a588da0 $ */ If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); @@ -61,18 +61,18 @@ class editgroup_panel extends admin_module{ $panel->content.="

Gruppename:

"; $panel->field(array("name"=>"name","typ"=>"text","value"=>$data["role_name"])); $panel->content.="

"; - $panel->content.=" + $panel->content.="
"; - $result = $db->query("SELECT * FROM " . $config["prefix"] . "role_values"); + $drow = array(); + $result = $db->query("SELECT * FROM `" . $config["prefix"] . "role_values`"); while ($row = $db->fetch_array($result)){ - $rval =$db->fetch_array($db->query("SELECT value FROM `" . $config["prefix"] . "roleset` WHERE role_value_id='".$row["id"]."' AND role_id='".$data["id"]."'")); - $row["value"]=$rval["value"]; - $rdata[]=$row; - } - foreach ($rdata as $d){ - $panel->content.=""; + $rval =$db->fetch_array($db->query("SELECT `value` FROM `" . $config["prefix"] . "roleset` WHERE role_value_id='".$row["id"]."' AND role_id='".$data["id"]."'")); + if(empty($rval["value"])){ + $rval["value"] = 0; + } + $panel->content.=""; } $panel->content.="
Rechte
".$d["text"].":
".$this->get_option($d["type"],$d["id"],$d["value"])."
".$row["text"].":
".$panel->get_option($row["type"],$row["id"],$rval["value"])."

"; $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); @@ -83,7 +83,7 @@ class editgroup_panel extends admin_module{ $panel->parse_page(); } - }elseif($_GET["action"]=="delete" && $_GET["group"]){ + }elseif(isset($_GET["action"]) && $_GET["action"]=="delete" && isset($_GET["group"])){ $result=$db->query("SELECT id FROM `" . $config["prefix"] . "role` where `role_name`='User' LIMIT 1"); $row = $db->fetch_array($result); $db->query("UPDATE `" . $config["prefix"] . "users` SET `role`='".$row["id"]."' WHERE `role`='".intval($_GET["group"])."'"); @@ -97,117 +97,35 @@ class editgroup_panel extends admin_module{ $role[]=$row; } $panel->title="Vorhandene Rollen"; - $panel->content.=" + $panel->content.="
- - - + + + "; if(!empty($role)){ foreach($role as $u){ $panel->content.=" - - "; + + "; if(!$u["special_group"]){ - $panel->content.=" + $panel->content.=""; }else{ - $panel->content.=" + $panel->content.=""; } } }else{ $panel->content.=" - + "; } $panel->content.="
IDNameAktionenIDNameAktionen
".$u["id"]."".$u["role_name"]."".$u["id"]."".$u["role_name"]."
Keine Rollen vorhanden.Keine Rollen vorhanden.

"; } } - function get_option($option,$name,$value) { - global $config,$db,$panel,$userinfo,$admin,$root,$firephp; - - if($option=="yesno"){ - $checked["yes"]=""; - $checked["no"]=""; - if($value==1||$value==True||$value=="yes"){ - $checked["yes"]='checked="checked"'; - }else{ - $checked["no"]='checked="checked"'; - } - $yn=$panel->radio(array("name"=>$name,"value"=>"1"),$checked["yes"],TRUE); - $yn.="Ja"; - $yn.=$panel->radio(array("name"=>$name,"value"=>"0"),$checked["no"],TRUE); - $yn.="Nein"; - return $yn; - } - if($option=="onoff"){ - $checked["on"]=""; - $checked["off"]=""; - if($value==1||$value==True||$value=="on"){ - $checked["on"]='checked="checked"'; - }else{ - $checked["off"]='checked="checked"'; - } - $yn=$panel->radio(array("name"=>$name,"value"=>"1"),$checked["on"],TRUE); - $yn.="An"; - $yn.=$panel->radio(array("name"=>$name,"value"=>"0"),$checked["off"],TRUE); - $yn.="Aus"; - return $yn; - } - if($option=="text"){ - $text=$panel->field(array("name"=>$name,"typ"=>"text","value"=>$value),"",TRUE); - return $text; - } - - if(strstr($option,"wysiwyg")){ - $string=str_replace("wysiwyg(","",substr($option, 0, -1)); - $sarr=explode(";",$string); - foreach($sarr as $str){ - $substr=explode("|",$str); - $a_name[]=$substr[0]; - $value[]=$substr[1]; - } - if(is_array($sarr)){ - $text=$panel->textarea(array("name"=>$name,"value"=>$value, $a_name[0]=>$value[0],$a_name[1]=>$value[1]),"class=\"mceEditor\"",TRUE); - }else{ - $text=$panel->textarea(array("name"=>$name,"value"=>$value),"class=\"mceEditor\"",TRUE); - } - return $text; - } - - if(strstr($option,"textarea")){ - $string=str_replace("textarea(","",substr($option, 0, -1)); - $sarr=explode(";",$string); - foreach($sarr as $str){ - $substr=explode("|",$str); - $a_name[]=$substr[0]; - $value[]=$substr[1]; - } - if(is_array($sarr)){ - $text=$panel->textarea(array("name"=>$name,"value"=>$value, $a_name[0]=>$value[0],$a_name[1]=>$value[1]),"",TRUE); - }else{ - $text=$panel->textarea(array("name"=>$name,"value"=>$value),"",TRUE); - } - return $text; - } - - if(strstr($option,"select")){ - //$text=$panel->field("text",$name,"value=\"".$config[$name]."\"",TRUE); - $string=str_replace("select(","",substr($option, 0, -1)); - $sarr=explode(";",$string); - foreach($sarr as $str){ - $substr=explode("|",$str); - $values[$substr[0]]=$substr[1]; - } - $select=$panel->select($values,$value,$name,"",TRUE); - return $select; - } - - } - function meta() { global $module,$config,$db,$panel,$userinfo,$admin,$root; $meta=' diff --git a/admin/editusers.apnl.php b/admin/editusers.apnl.php index fad2dd5..3045457 100644 --- a/admin/editusers.apnl.php +++ b/admin/editusers.apnl.php @@ -22,7 +22,7 @@ * @author Bernhard Jaud * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: 9dc39c20490c4f2db08d39ade0b9455db4ba286a $ */ If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); @@ -46,7 +46,7 @@ class editusers_panel extends admin_module{ if($_POST["password"]!=""){ $pwd=", `password`='".hash("sha256",$salt.$db->escape($_POST["password"]))."', `loginkey`='".$_POST['key']."',`salt` = '".$salt."'"; } - $plugin->run_hook('admin_user_before_update',array('data'=>$_POST,'key'=>$key,'user_fid'=>$session->userdata['fuid'])); + $plugin->run_hook('admin_user_before_update',array('data'=>$_POST,'user_fid'=>$session->userdata['fuid'])); $db->query("UPDATE `" . $config["prefix"] . "users` SET `username`='".$db->escape($_POST["name"])."',`realname`='".$db->escape($_POST["realname"])."',`email`='".$db->escape($_POST["email"])."',`from`='".$db->escape($_POST["from"])."',`gender`='".$db->escape($_POST["gender"])."',`bio`='".$db->escape($_POST["bio"])."',`homepage`='".$db->escape($_POST["homepage"])."',`role`='".$db->escape($_POST["role"])."',`active`='".$db->escape($_POST["active"])."',".$pwd." WHERE `uid`='".intval($_POST["uid"])."'"); $_POST['user_fid']=$session->userdata['fuid']; $plugin->run_hook('admin_user_after_update',array('data'=>$_POST)); @@ -108,15 +108,15 @@ class editusers_panel extends admin_module{ $user[]=$row; } $panel->title=$lang->_('USERS'); - $panel->content.=" + $panel->content.="
- - - - - - + + + + + + "; if(!empty($user)){ foreach($user as $u){ @@ -131,22 +131,22 @@ class editusers_panel extends admin_module{ $u['activestyle']='style="font-style:italic;"'; } $panel->content.=" - - - - - "; + + + + + "; if($u["uid"]==$session->userdata["uid"]){ - $panel->content.=" + $panel->content.=""; }else{ - $panel->content.=" + $panel->content.=""; } } }else{ $panel->content.=" - + "; } $panel->content.="
".$lang->_('ID')."".$lang->_('USERNAME')."".$lang->_('REALNAME')."".$lang->_('ROLE')."".$lang->_('STATUS')."".$lang->_('ACTION')."".$lang->_('ID')."".$lang->_('USERNAME')."".$lang->_('REALNAME')."".$lang->_('ROLE')."".$lang->_('STATUS')."".$lang->_('ACTION')."
".$u["uid"]."".$u["username"]."".$u["realname"]."".$u["role_name"]."".$u['activetext']."".$u["uid"]."".$u["username"]."".$u["realname"]."".$u["role_name"]."".$u['activetext']."_('BADIDEA')."')\" href=\"".$config["path"]."/admin/index.php?panel=editusers&action=delete&user=".$u["uid"]."\"> _('BADIDEA')."')\" href=\"".$config["path"]."/admin/index.php?panel=editusers&action=delete&user=".$u["uid"]."\">
_('DELETEUSER'),$u["username"])."')\" href=\"".$config["path"]."/admin/index.php?panel=editusers&action=delete&user=".$u["uid"]."\"> _('DELETEUSER'),$u["username"])."')\" href=\"".$config["path"]."/admin/index.php?panel=editusers&action=delete&user=".$u["uid"]."\">
".$lang->_('NOUSERS')."".$lang->_('NOUSERS')."

"; diff --git a/admin/index.php b/admin/index.php index 5dca4fa..78c1e17 100644 --- a/admin/index.php +++ b/admin/index.php @@ -22,7 +22,7 @@ * @author Bernhard Jaud * @package BeCast Webengine core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: 28fe87cea02728845f7d402ec06e0268a2b4d472 $ */ ERROR_REPORTING(E_ALL ^E_NOTICE); $basepath=""; @@ -80,6 +80,9 @@ if(isset($session->userdata['uid']) && $session->userdata['uid']!=0 && ($sessio $result = $db->query("SHOW TABLE STATUS"); while ($row = $db->fetch_array($result)) { + if(empty($row['Rows'])){ + $row['Rows'] = 0; + } $total_rows += $row['Rows']; $total_data += $row['Data_length']; $total_index += $row['Index_length']; diff --git a/admin/module.apnl.php b/admin/module.apnl.php index ecde576..8a5abd6 100644 --- a/admin/module.apnl.php +++ b/admin/module.apnl.php @@ -22,7 +22,7 @@ * @author Bernhard Jaud * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: e4eaafcfd11039c76025c274425ece9809767876 $ */ If (!defined("IN_BCWE_ADMIN")) { @@ -65,13 +65,13 @@ class module_panel extends admin_module{ $panel->title="Modulverwaltung"; $panel->content.="

Installierte Module


- +
- - - - - + + + + + "; if(!empty($core->mod_)){ foreach($core->mod_ as $mod){ @@ -88,11 +88,11 @@ class module_panel extends admin_module{ $depends.='
hängt ab von: '.$deps; } $panel->content.=" - - - - - + + + + + "; unset($deps); unset($depends); @@ -100,19 +100,19 @@ class module_panel extends admin_module{ } }else{ $panel->content.=" - + "; } $panel->content.="
ModulVersionAutorHomepageAktionModulVersionAutorHomepageAktion
".$mod["name"].$depends."".$mod["version"]."".$mod["author"]."".$mod["url"]."Deinstallieren".$mod["name"].$depends."".$mod["version"]."".$mod["author"]."".$mod["url"]."Deinstallieren
Keine Module verfügbar.Keine Module verfügbar.

"; $panel->content.="

Nicht Installierte Module


"; - $panel->content.=" + $panel->content.="
- - - - - + + + + + "; $modules=$this->avaiable_modules(); @@ -131,11 +131,11 @@ class module_panel extends admin_module{ $depends.='
hängt ab von: '.$deps; } $panel->content.=" - - - - - + + + + + "; unset($deps); unset($depends); @@ -143,7 +143,7 @@ class module_panel extends admin_module{ } }else{ $panel->content.=" - + "; } $panel->content.="
ModulVersionAutorHomepageAktionModulVersionAutorHomepageAktion
".$mod["name"].$depends."".$mod["version"]."".$mod["author"]."".$mod["url"]."Installieren".$mod["name"].$depends."".$mod["version"]."".$mod["author"]."".$mod["url"]."Installieren
Keine Module verfügbar.Keine Module verfügbar.
"; diff --git a/admin/navigation.apnl.php b/admin/navigation.apnl.php index b03e6d4..a6ddf28 100644 --- a/admin/navigation.apnl.php +++ b/admin/navigation.apnl.php @@ -1,4 +1,4 @@ - * @package BeCast WebEngine core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: 3b8272c8cbeb69ce9d3bda8405887ab373a19d9e $ */ If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); diff --git a/admin/versions.apnl.php b/admin/versions.apnl.php index d9f24f1..7acb1b1 100644 --- a/admin/versions.apnl.php +++ b/admin/versions.apnl.php @@ -1,4 +1,4 @@ - * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: 1eb16074139417e5c0ba8cee93003e66221035d4 $ */ If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); @@ -45,104 +45,101 @@ class versions_panel extends admin_module{ $dir_objects[] = $file_object; } - $url="http://www.astat.org/versions.php"; - $file = @fopen($url,"r"); - if($file != false){ - $data = @fread($file,"4048"); - $xml=new xml(); - $out = $xml->parse($data, NULL); + $url="https://webengine.becast.at/index.php?task=versioncheck"; + $out = xml2array($url); + if(!empty($out)){ $i=0; - $max=count($out["mod"]); + $max=count($out['release']["mod"]); while($i<=$max){ - $versions[$i]["name"]=$out["mod"][$i]; - $versions[$i]["ver"]=$out["ver"][$i]; + $versions[$i]["name"]=$out['release']["mod"][$i]["name"]; + $versions[$i]["ver"]=$out['release']["mod"][$i]["ver"]; + $versions[$i]["file"]=$out['release']["mod"][$i]["file"]; $i++; } $vers=$core->ver_major.".".$core->ver_minor.".".$core->ver_rev; $panel->title="Moduleversionen"; - $panel->content.=" + $panel->content.="
- - - + + + "; - if($out["relase"]["version"]>$vers){ - $panel->content.=""; + if($out["release"]["version"]>$vers){ + $panel->content.=""; }else{ - - foreach($module as $mod){ - $panel->content.=" - - "; - foreach($versions as $v){ - if($v["name"]==$mod["name"]){ - if($mod["ver"]<$v["ver"]){ - $panel->content.=""; - }elseif($mod["ver"]==$v["ver"]){ - $panel->content.=""; - }else{ - $panel->content.=""; - } - } - } - $panel->content.=""; - - } - foreach($core->mod_ as $mod){ - $panel->content.=" - - "; + foreach($module as $mod){ + $panel->content.=" + + "; foreach($versions as $v){ - if($v["name"]==$mod["name"]){ - if($mod["version"]<$v["ver"]){ - $panel->content.=""; - }elseif($mod["version"]==$v["ver"]){ - $panel->content.=""; - }else{ - $panel->content.=""; - } + if($v["name"]==$mod["name"]){ + if($mod["ver"]<$v["ver"]){ + $panel->content.=""; + }elseif($mod["ver"]==$v["ver"]){ + $panel->content.=""; + }else{ + $panel->content.=""; } } - $panel->content.=""; - } - } - $panel->content.="
ModulVersionUpdateModulVersionUpdate
Diese Version ist nicht mehr aktuell.
Besuche die Projektseite für ein Update
Diese Version ist nicht mehr aktuell.
Besuche die Projektseite für ein Update
".$mod["name"]."".$mod["ver"]."Neue Version verfügbar!AktuellModified file?
".$mod["name"]."".$mod["version"]."
".$mod["name"]."".$mod["ver"]."Neue Version verfügbar!AktuellModified file?Neue Version verfügbar!AktuellModified file?

"; - $panel->parse_page(); - }else{ - $panel->title="Moduleversionen"; - $panel->content.="Die Versionprüfung ist fehlgeschlagen."; - $panel->content.=" - - - - "; - - - foreach($module as $mod){ - $panel->content.=" - - "; - $panel->content.=""; - } - $panel->content.="
ModulVersion
".$mod["name"]."".$mod["ver"]."

"; - $panel->parse_page(); - } - $panel->title="Datei Infos"; - $panel->content.=" - - - - - "; - foreach($dir_objects as $files){ - $panel->content.=" - - - - "; - } + } + $panel->content.=""; - $panel->content.="
DateiGrößezuletzt Geändert
".$files["name"]."".$files["size"]."".$files["time"]."
"; + } + foreach($core->mod_ as $mod){ + $panel->content.=" + ".$mod["name"]." + ".$mod["version"].""; + foreach($versions as $v){ + if($v["name"]==$mod["name"]){ + if($mod["version"]<$v["ver"]){ + $panel->content.="Neue Version verfügbar!"; + }elseif($mod["version"]==$v["ver"]){ + $panel->content.="Aktuell"; + }else{ + $panel->content.="Modified file?"; + } + } + } + $panel->content.=""; + } + } + $panel->content.="
"; + $panel->parse_page(); + }else{ + $panel->title="Moduleversionen"; + $panel->content.="Die Versionprüfung ist fehlgeschlagen."; + $panel->content.=" + + + + "; + + + foreach($module as $mod){ + $panel->content.=" + + "; + $panel->content.=""; + } + $panel->content.="
ModulVersion
".$mod["name"]."".$mod["ver"]."

"; + $panel->parse_page(); + } + $panel->title="Datei Infos"; + $panel->content.=" + + + + + "; + foreach($dir_objects as $files){ + $panel->content.=" + + + + "; + } + + $panel->content.="
DateiGrößezuletzt Geändert
".$files["name"]."".$files["size"]."".$files["time"]."
"; } function byteConvert( $bytes ) { @@ -180,315 +177,142 @@ class versions_panel extends admin_module{ } -class Xml { - - /** - * Xml parser container. - * - * @var resource parser - */ - var $parser; - - /** - * Parse result. - * - * @var array pOut - */ - var $pOut = array(); - - /** - * Contain the overlap tag temporarily . - * - * @var array track - */ - var $track = array(); - - /** - * Current tag level. - * - * @var string tmpLevel - */ - var $tmpLevel = ''; - - /** - * Attribut of current tag. - * - * @var array tmpAttrLevel - */ - var $tmpAttrLevel = array(); - - /** - * Write result. - * - * @var string wOut - */ - var $wOut = ''; - - - - - /** - * parse - * Set the parser Xml and theses options. - * Xml file could be a string, a file, or curl. - * When the source is loaded, we run the parse. - * After, we clean all the memory and variables, - * and return the result in an array. - * - * @access public - * @param src string Source - * @param typeof string Source type : NULL, FILE, CURL. - * @param encoding string Encoding type. - * @return array - */ - function parse ( $src, $typeof = 'FILE', $encoding = 'UTF-8' ) { - - // ini; - // (re)set array; - $this->pOut = array(); - $this->parser = xml_parser_create(); - - xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); - xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, $encoding); - - xml_set_object($this->parser, $this); - xml_set_element_handler($this->parser, 'startHandler', 'endHandler'); - xml_set_character_data_handler($this->parser, 'contentHandler'); - - if(empty($src)) - trigger_error('Source could not be empty.', E_USER_ERROR); - - // format source; - if($typeof == NULL) - $data = $src; - elseif($typeof == 'FILE') { - $fop = fopen($src, 'r'); - $data = null; - while(!feof($fop)) - $data .= fread($fop, 1024); - fclose($fop); + function xml2array($url, $get_attributes = 1, $priority = 'tag') + { + $contents = ""; + if (!function_exists('xml_parser_create')) + { + return array (); } - elseif($typeof == 'CURL') { - $curl = curl_init(); - curl_setopt($curl, CURLOPT_URL, $src); - curl_setopt($curl, CURLOPT_HEADER, 0); - $data = curl_exec($curl); - curl_close($curl); + $parser = xml_parser_create(''); + if (!($fp = @ fopen($url, 'rb'))) + { + return array (); } - else - return trigger_error('Xml parser need data.', E_USER_ERROR); - - // parse $data; - $parse = xml_parse($this->parser, $data); - if(!$parse) - return trigger_error('XML Error : %s at line %d.', E_USER_ERROR, - array(xml_error_string(xml_get_error_code($this->parser)), - xml_get_current_line_number($this->parser))); - - // destroy parser; - xml_parser_free($this->parser); - - // unset extra vars; - unset($data, - $this->track, - $this->tmpLevel); - - // remove global tag and return the result; - return $this->pOut[0][key($this->pOut[0])]; - } - - - - /** - * startHandler - * Manage the open tag, and these attributs by callback. - * The purpose is to create a pointer : {{int ptr}}. - * If the pointer exists, we have a multi-tag situation. - * Tag name is stocked like : '' - * Attributs is stocked like : '-ATTR' - * Return true but built $this->pOut. - * - * @access private - * @param parser resource Parser resource. - * @param tag string Tag name. - * @param attr array Attribut. - * @return bool - */ - function startHandler ( $parser, $tag, $attr ) { - - // built $this->track; - $this->track[] = $tag; - // place pointer to the end; - end($this->track); - // temp level; - $this->tmpLevel = key($this->track); - - // built attrLevel into $this->tmpAttrLevel - if(isset($this->tmpAttrLevel[$this->tmpLevel]['attrLevel'])) - $this->tmpAttrLevel[$this->tmpLevel]['attrLevel']++; - - // built $this->pOut; - if(!isset($this->pOut[key($this->track)][$tag])) { - $this->pOut[key($this->track)][$tag] = '{{'.key($this->track).'}}'; - - if(!isset($this->tmpAttrLevel[$this->tmpLevel]['attrLevel'])) - $this->tmpAttrLevel[$this->tmpLevel]['attrLevel'] = 0; + while (!feof($fp)) + { + $contents .= fread($fp, 8192); } - - // built attributs; - if(!empty($attr)) { - - $this->tmpAttrLevel[$this->tmpLevel][] = $this->tmpAttrLevel[$this->tmpLevel]['attrLevel']; - end($this->tmpAttrLevel[$this->tmpLevel]); - - // it's the first attribut; - if(!isset($this->pOut[key($this->track)][$tag.'-ATTR'])) - $this->pOut[key($this->track)][$tag.'-ATTR'] = $attr; - - // or it's not the first; - else { - // so it's the second; - if(!prev($this->tmpAttrLevel[$this->tmpLevel])) { - $this->pOut[key($this->track)][$tag.'-ATTR'] = array( - current($this->tmpAttrLevel[$this->tmpLevel]) => $this->pOut[key($this->track)][$tag.'-ATTR'], - next($this->tmpAttrLevel[$this->tmpLevel]) => $attr - ); - } - // or one other; + fclose($fp); + xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8"); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); + xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); + xml_parse_into_struct($parser, trim($contents), $xml_values); + xml_parser_free($parser); + if (!$xml_values) + return; //Hmm... + $xml_array = array (); + $parents = array (); + $opened_tags = array (); + $arr = array (); + $current = & $xml_array; + $repeated_tag_index = array (); + foreach ($xml_values as $data) + { + unset ($attributes, $value); + extract($data); + $result = array (); + $attributes_data = array (); + if (isset ($value)) + { + if ($priority == 'tag') + $result = $value; else - $this->pOut[key($this->track)][$tag.'-ATTR'][$this->tmpAttrLevel[$this->tmpLevel]['attrLevel']] = $attr; + $result['value'] = $value; } - } - - return true; - } - - - - /** - * contentHandler - * Detect the pointer, or the multi-tag by callback. - * If we have a pointer, the method replaces this pointer by the content. - * Else we have a multi-tag, the method add a element to this array. - * Return true but built $this->pOut. - * - * @access private - * @param parser resource Parser resource. - * @param contentHandler string Tag content. - * @return bool - */ - function contentHandler ( $parser, $contentHandler ) { - - // remove all spaces; - if(!preg_match('#^\\\\s*$#', $contentHandler)) { - - // $contentHandler is a string; - if(is_string($this->pOut[key($this->track)][current($this->track)])) { - - // then $contentHandler is a pointer : {{int ptr}} case 1; - if(preg_match('#{{([0-9]+)}}#', $this->pOut[key($this->track)][current($this->track)])) - $this->pOut[key($this->track)][current($this->track)] = $contentHandler; - - // or then $contentHandler is a multi-tag content case 2; - else { - $this->pOut[key($this->track)][current($this->track)] = array( - 0 => $this->pOut[key($this->track)][current($this->track)], - 1 => $contentHandler - ); - } - } - // or $contentHandler is an array; - else { - - // then $contentHandler is the multi-tag array case 1; - if(isset($this->pOut[key($this->track)][current($this->track)][0])) - $this->pOut[key($this->track)][current($this->track)][] = $contentHandler; - - // or then $contentHandler is a node-tag case 2; - else - $this->pOut[key($this->track)][current($this->track)] = array( - 0 => $this->pOut[key($this->track)][current($this->track)], - 1 => $contentHandler - ); - } - - } - - return true; - } - - - - /** - * endHandler - * Detect the last pointer by callback. - * Move the last tags block up. - * And reset some temp variables. - * Return true but built $this->pOut. - * - * @access private - * @param parser resource Parser resource. - * @param tag string Tag name. - * @return bool - */ - function endHandler ( $parser, $tag ) { - - // if level--; - if(key($this->track) == $this->tmpLevel-1) { - // search up tag; - // use array_keys if an empty tag exists (taking the last tag); - - // if it's a normal framaset; - $keyBack = array_keys($this->pOut[key($this->track)], '{{'.key($this->track).'}}'); - $count = count($keyBack); - - if($count != 0) { - $keyBack = $keyBack[$count-1]; - // move this level up; - $this->pOut[key($this->track)][$keyBack] = $this->pOut[key($this->track)+1]; - } - - // if we have a multi-tag framaset ($count == 0); - else { - // if place is set; - if(isset($this->pOut[key($this->track)][current($this->track)][0])) { - - // if it's a string, we built an array; - if(is_string($this->pOut[key($this->track)][current($this->track)])) - $this->pOut[key($this->track)][current($this->track)] = array( - 0 => $this->pOut[key($this->track)][current($this->track)], - 1 => $this->pOut[key($this->track)+1] - ); - - // else add an index into the array; + if (isset ($attributes) and $get_attributes) + { + foreach ($attributes as $attr => $val) + { + if ($priority == 'tag') + $attributes_data[$attr] = $val; else - $this->pOut[key($this->track)][current($this->track)][] = $this->pOut[key($this->track)+1]; + $result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr' } - // else set the place; - else - $this->pOut[key($this->track)][current($this->track)] = array( - 0 => $this->pOut[key($this->track)][current($this->track)], - 1 => $this->pOut[key($this->track)+1] - ); } - - // kick $this->pOut level out; - array_pop($this->pOut); - end($this->pOut); + if ($type == "open") + { + $parent[$level -1] = & $current; + if (!is_array($current) or (!in_array($tag, array_keys($current)))) + { + $current[$tag] = $result; + if ($attributes_data) + $current[$tag . '_attr'] = $attributes_data; + $repeated_tag_index[$tag . '_' . $level] = 1; + $current = & $current[$tag]; + } + else + { + if (isset ($current[$tag][0])) + { + $current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result; + $repeated_tag_index[$tag . '_' . $level]++; + } + else + { + $current[$tag] = array ( + $current[$tag], + $result + ); + $repeated_tag_index[$tag . '_' . $level] = 2; + if (isset ($current[$tag . '_attr'])) + { + $current[$tag]['0_attr'] = $current[$tag . '_attr']; + unset ($current[$tag . '_attr']); + } + } + $last_item_index = $repeated_tag_index[$tag . '_' . $level] - 1; + $current = & $current[$tag][$last_item_index]; + } + } + elseif ($type == "complete") + { + if (!isset ($current[$tag])) + { + $current[$tag] = $result; + $repeated_tag_index[$tag . '_' . $level] = 1; + if ($priority == 'tag' and $attributes_data) + $current[$tag . '_attr'] = $attributes_data; + } + else + { + if (isset ($current[$tag][0]) and is_array($current[$tag])) + { + $current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result; + if ($priority == 'tag' and $get_attributes and $attributes_data) + { + $current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data; + } + $repeated_tag_index[$tag . '_' . $level]++; + } + else + { + $current[$tag] = array ( + $current[$tag], + $result + ); + $repeated_tag_index[$tag . '_' . $level] = 1; + if ($priority == 'tag' and $get_attributes) + { + if (isset ($current[$tag . '_attr'])) + { + $current[$tag]['0_attr'] = $current[$tag . '_attr']; + unset ($current[$tag . '_attr']); + } + if ($attributes_data) + { + $current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data; + } + } + $repeated_tag_index[$tag . '_' . $level]++; //0 and 1 index is already taken + } + } + } + elseif ($type == 'close') + { + $current = & $parent[$level -1]; + } } - - // re-temp level; - $this->tmpLevel = key($this->track); - - while(isset($this->tmpAttrLevel[$this->tmpLevel+1])) - array_pop($this->tmpAttrLevel); - - // kick $this->track level out; - array_pop($this->track); - end($this->track); - - return true; + return ($xml_array); } -} -?> diff --git a/core/database/mysql.class.php b/core/database/mysql.class.php deleted file mode 100644 index 6c4299d..0000000 --- a/core/database/mysql.class.php +++ /dev/null @@ -1,190 +0,0 @@ - - * @package astat core - * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id: mysql.class.php 104 2010-02-20 19:16:12Z genuineparts $ -*/ - -$module["db"]["name"]="Database Class (mysql)"; -$module["db"]["ver"]="1.0.1"; -class db { - var $host=""; - var $user="root"; - var $password=""; - var $db="becast"; - var $encoding; - var $logging; - var $abfragen=0; - var $exception; - private $conid=FALSE; - public const ASSOC = 1; - public const NUM = 2; - public const BOTH = 3; - - function __construct($host,$user,$password,$db,$encoding="utf8",$logging=false,$exception=false) { - global $log,$config; - $this->host=$host; - $this->user=$user; - $this->password=$password; - $this->db=$db; - $this->logging=$logging; - $this->exception=$exception; - - if($this->logging==FALSE && DEBUG!=FALSE){ - $this->logger=new logger("file",dirname(dirname(dirname(__FILE__))).'/logs/mysql_debug.log',5); - }elseif($this->logging){ - $this->logger=new logger("file",dirname(dirname(dirname(__FILE__))).'/logs/mysql.log'); - } - - $this->encoding=$encoding; - $this->conid; - - if($this->logging) - $this->logger->write("mySQL Klasse instanziert", 5); - if(!$this->conid){ - if($this->logging) - $this->logger->write("Connection zu mySQL Server besteht nicht.", 5,__LINE__,__FILE__); - $this->conid=$this->connect($this->host,$this->user,$this->password,$this->db,$this->encoding); - }else{ - if($this->logging) - $this->logger->write("Connection zu mySQL Server besteht. ID ".$this->conid, 5,__LINE__,__FILE__); - } - if($this->encoding) - $this->query("SET NAMES '".$this->encoding."'"); - } - - function __destruct() { - $this->disconnect(); - } - - function connect($host, $user, $password, $db, $encoding){ - $conn = @mysql_connect($host, $user, $password); - if($this->logging) - $this->logger->write("Connect to Mysql Server", 5,__LINE__,__FILE__); - - if(!$conn){ - if($this->exception){ - throw new Exception('mySQLi Connect failed'); - }else{ - trigger_error("mySQL Connect failed",E_USER_ERROR); - - if($this->logging) - $this->logger->write("Connect Failed ". $this->error(), 5,__LINE__,__FILE__); - die(); - } - }else{ - if($this->logging) - $this->logger->write("Selecting Database ".$db, 5,__LINE__,__FILE__); - } - - $conn2 = @mysql_select_db($db,$conn); - if($this->logging) - $this->logger->write("Connect to Mysql Server", 5,__LINE__,__FILE__); - - if(!$conn2){ - include('templates/general_error.tpl'); - - if($this->logging) - $this->logger->write("Select failed ". $this->error(), 5,__LINE__,__FILE__); - die(); - }else{ - if($this->logging) - $this->logger->write("Database ".$db." selected", 5,__LINE__,__FILE__); - } - - return $conn; - } - - - function disconnect(){ - if($this->logging) - $this->logger->write("Closing Mysql Connection.", 5,__LINE__,__FILE__); - - @mysql_close($this->conid); - } - - function query($query){ - global $abfragen; - - if($this->logging) - $this->logger->write($query." ". $this->conid, 5,__LINE__,__FILE__); - - $this->abfragen++; - $res = mysql_query($query, $this->conid); - return $res; - } - - function querys(){ - return $this->abfragen; - } - - function num_rows($result){ - $rows = mysql_num_rows($result); - return $rows; - } - - function fetch_row($result){ - $row = mysql_fetch_row($result); - return $row; - } - - function fetch_array($result){ - $row = array(); - $row = mysql_fetch_array($result, MYSQL_ASSOC); - return $row; - } - - function escape($string){ - $return = mysql_real_escape_string($string); - return $return; - } - - function escape_binary($string){ - return "X'".$this->escape(bin2hex($string))."'"; - } - - function fetch_object($result){ - $row = mysql_fetch_object($result); - return $row; - } - - function error(){ - $error = mysql_error($this->conid); - return $error; - } - - function errno(){ - $errno = mysql_errno($this->conid); - return $errno ; - } - - function free_result($result){ - mysql_free_result($result); - } - - function last_id(){ - $id = mysql_insert_id($this->conid); - return $id; - } -} -?> diff --git a/core/database/mysqli.class.php b/core/database/mysqli.class.php index c72d787..0fa0612 100644 --- a/core/database/mysqli.class.php +++ b/core/database/mysqli.class.php @@ -1,6 +1,6 @@ - * @package astat core + * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id: mysqli.class.php 126 2010-02-21 21:07:52Z genuineparts $ -*/ + * @version $Id: 04fd2c27ac07acf18e32d57d6fa972322831dfac $ + */ $module["db"]["name"]="Database Class (mysqli)"; -$module["db"]["ver"]="1.0.1"; +$module["db"]["ver"]="1.0.2"; class db { var $mysqli; var $host=""; @@ -119,31 +119,23 @@ class db { function querys(){ return $this->abfragen; - } + } function num_rows($result){ - $rows = $result->num_rows; - return $rows; - } + return $result->num_rows; + } function fetch_row($result){ - $row = $result->fetch_row(); - return $row; - } + return $result->fetch_row(); + } function fetch_array($result){ - - $row = array(); - $row = $result->fetch_array(MYSQLI_ASSOC); - return $row; - } + return $result->fetch_array(MYSQLI_ASSOC); + } function fetch_array_num($result){ - - $row = array(); - $row = $result->fetch_array(MYSQLI_NUM ); - return $row; - } + return $result->fetch_array(MYSQLI_NUM); + } function escape($string){ $return = $this->mysqli->real_escape_string($string); diff --git a/core/init_core.inc.php b/core/init_core.inc.php index 646f8f2..9f13241 100644 --- a/core/init_core.inc.php +++ b/core/init_core.inc.php @@ -22,7 +22,7 @@ * @author Bernhard Jaud * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: 646f8f2e01e54ae7ca58752e01a9cd58299d9a4c $ */ define("INBCWE", true); diff --git a/error/400.html b/error/400.html deleted file mode 100644 index 39fd163..0000000 --- a/error/400.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - ERROR 400 - Bad Request! - - - - - -
- -
-

The following error occurred:

-

You have used invalid syntax.

-

Please contact the webmaster with any queries.

-
- -
- - diff --git a/error/401.html b/error/401.html deleted file mode 100644 index 28fc2a0..0000000 --- a/error/401.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - ERROR 401 - Unauthorized! - - - - - -
- -
-

The following error occurred:

-

The URL requested requires authorisation.

-

Please contact the webmaster with any queries.

-
- -
- - diff --git a/error/403.html b/error/403.html deleted file mode 100644 index 676f713..0000000 --- a/error/403.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - ERROR 403 - Forbidden! - - - - - -
- -
-

The following error occurred:

-

You are not permitted to access the requested URL.

-

Please contact the webmaster with any queries.

-
- -
- - diff --git a/error/404.html b/error/404.html deleted file mode 100644 index 78452ba..0000000 --- a/error/404.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - ERROR 404 - Not Found! - - - - - -
- -
-

The following error occurred:

-

The requested URL was not found on this server.

-

Please check the URL or contact the webmaster.

-
- -
- - diff --git a/error/405.html b/error/405.html deleted file mode 100644 index c9ed8f6..0000000 --- a/error/405.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - ERROR 405 - Method Not Allowed! - - - - - -
- -
-

The following error occurred:

-

The method used is not permitted.

-

Please contact the webmaster with any queries.

-
- -
- - diff --git a/error/500.html b/error/500.html deleted file mode 100644 index 43864a7..0000000 --- a/error/500.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - ERROR 500 - Internal Server Error! - - - - - -
- -
-

The following error occurred:

-

The requested URL caused an internal server error.

-

If you get this message repeatedly please contact the webmaster.

-
- -
- - diff --git a/error/502.html b/error/502.html deleted file mode 100644 index 62a1b02..0000000 --- a/error/502.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - ERROR 502 - Bad Gateway! - - - - - -
- -
-

The following error occurred:

-

This server received an invalid response from an upstream server it accessed to fulfill the request.

-

If you get this message repeatedly please contact the webmaster.

-
- -
- - diff --git a/error/503.html b/error/503.html deleted file mode 100644 index eb55a56..0000000 --- a/error/503.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - ERROR 503 - Service Unavailable! - - - - - -
- -
-

The following error occurred:

-

The Service is not available at the moment due to a temporary overloading or maintenance of the server. Please try again later.

-

Please contact the webmaster with any queries.

-
- -
- - diff --git a/forumplugins/chatusers.php b/forumplugins/chatusers.php index 589cf11..92f1758 100644 --- a/forumplugins/chatusers.php +++ b/forumplugins/chatusers.php @@ -62,7 +62,7 @@ function get_user_list() { $ch = curl_init(); // setze die URL und andere Optionen - curl_setopt($ch, CURLOPT_URL, "https://chatsrv.austriachat.net/info"); + curl_setopt($ch, CURLOPT_URL, "https://chat.funch.at/info"); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); @@ -103,7 +103,6 @@ function get_user_list() { } function chat_online(){ $online=get_user_list(); - if($online){ $rooms=array_keys($online); $i=0; @@ -124,7 +123,7 @@ function chat_online(){ } $data["usercount"]++; - $data[$i]["users"].=''.$user.''; + $data[$i]["users"].=''.$user.''; } $i++; diff --git a/forumplugins/forumsnav.php b/forumplugins/forumsnav.php index 74fe08a..4983b52 100644 --- a/forumplugins/forumsnav.php +++ b/forumplugins/forumsnav.php @@ -31,12 +31,12 @@ function forumsnav_info() * compatibility: A CSV list of MyBB versions supported. Ex, "121,123", "12*". Wildcards supported. */ return array( - "name" => "Forum Nav", + "name" => "Forum Nav", "description" => "Nav of forums in the header", - "website" => "http://funch.at", + "website" => "http://austriachat.net", "author" => "genuineparts", - "authorsite" => "http://funch.at", - "version" => "1.3", + "authorsite" => "http://austriachat.net", + "version" => "1.2", "guid" => "", "compatibility" => "*" ); @@ -45,7 +45,7 @@ function forumnav() { global $forumsnav,$mybb, $db; -$sql="SELECT * FROM `".$db->table_prefix."forums` WHERE `type`='f' AND active != 0 AND `pid` != 13 ORDER BY `pid`,`disporder`"; +$sql="SELECT * FROM `".TABLE_PREFIX."forums` WHERE `type`='f' AND active != 0 ORDER BY `pid`,`disporder`"; $result=$db->query($sql); while($row=$db->fetch_array($result)){ $forum .= '
  • '.$row['name'].'
  • '; @@ -53,5 +53,59 @@ $sql="SELECT * FROM `".$db->table_prefix."forums` WHERE `type`='f' AND active != $forumsnav=$forum; } +/** + * ADDITIONAL PLUGIN INSTALL/UNINSTALL ROUTINES + * + * _install(): + * Called whenever a plugin is installed by clicking the "Install" button in the plugin manager. + * If no install routine exists, the install button is not shown and it assumed any work will be + * performed in the _activate() routine. + * + * function hello_install() + * { + * } + * + * _is_installed(): + * Called on the plugin management page to establish if a plugin is already installed or not. + * This should return TRUE if the plugin is installed (by checking tables, fields etc) or FALSE + * if the plugin is not installed. + * + * function hello_is_installed() + * { + * global $db; + * if($db->table_exists("hello_world")) + * { + * return true; + * } + * return false; + * } + * + * _uninstall(): + * Called whenever a plugin is to be uninstalled. This should remove ALL traces of the plugin + * from the installation (tables etc). If it does not exist, uninstall button is not shown. + * + * function hello_uninstall() + * { + * } + * + * _activate(): + * Called whenever a plugin is activated via the Admin CP. This should essentially make a plugin + * "visible" by adding templates/template changes, language changes etc. + * + * function hello_activate() + * { + * } + * + * _deactivate(): + * Called whenever a plugin is deactivated. This should essentially "hide" the plugin from view + * by removing templates/template changes etc. It should not, however, remove any information + * such as tables, fields etc - that should be handled by an _uninstall routine. When a plugin is + * uninstalled, this routine will also be called before _uninstall() if the plugin is active. + * + * function hello_deactivate() + * { + * } + */ + ?> diff --git a/images/r2013_1.png b/images/r2013_1.png deleted file mode 100644 index f917edb..0000000 Binary files a/images/r2013_1.png and /dev/null differ diff --git a/images/r2013_10.png b/images/r2013_10.png deleted file mode 100644 index c335a72..0000000 Binary files a/images/r2013_10.png and /dev/null differ diff --git a/images/r2013_2.png b/images/r2013_2.png deleted file mode 100644 index 1945439..0000000 Binary files a/images/r2013_2.png and /dev/null differ diff --git a/images/r2013_3.png b/images/r2013_3.png deleted file mode 100644 index 9ab41af..0000000 Binary files a/images/r2013_3.png and /dev/null differ diff --git a/images/r2013_4.png b/images/r2013_4.png deleted file mode 100644 index 5cc1c96..0000000 Binary files a/images/r2013_4.png and /dev/null differ diff --git a/images/r2013_5.png b/images/r2013_5.png deleted file mode 100644 index 509dbc6..0000000 Binary files a/images/r2013_5.png and /dev/null differ diff --git a/images/r2013_6.png b/images/r2013_6.png deleted file mode 100644 index d80ee8d..0000000 Binary files a/images/r2013_6.png and /dev/null differ diff --git a/images/r2013_7.png b/images/r2013_7.png deleted file mode 100644 index eaa2c29..0000000 Binary files a/images/r2013_7.png and /dev/null differ diff --git a/images/r2013_8.png b/images/r2013_8.png deleted file mode 100644 index 66fa7ad..0000000 Binary files a/images/r2013_8.png and /dev/null differ diff --git a/images/r2013_9.png b/images/r2013_9.png deleted file mode 100644 index 15b7aac..0000000 Binary files a/images/r2013_9.png and /dev/null differ diff --git a/inc/cache.class.php b/inc/cache.class.php index b601fdb..a1ffd8f 100644 --- a/inc/cache.class.php +++ b/inc/cache.class.php @@ -24,7 +24,7 @@ $module["cache"]["ver"]="0.9.10"; * @author Bernhard Jaud * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: b601fdb3b3b6a18250440a6e5c09b910a45629c0 $ */ /* Already defined by PHP. I'll leave it here for Info diff --git a/inc/core.class.php b/inc/core.class.php index 85249e2..7a0f93d 100644 --- a/inc/core.class.php +++ b/inc/core.class.php @@ -22,11 +22,11 @@ * @author Bernhard Jaud * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: 421f3a896dfbf7885cd381975a57520bb1a9e7e5 $ */ $module['core']['name']='Core Class'; -$module['core']['ver']='1.0.0'; +$module['core']['ver']='1.1.0'; class Core{ @@ -184,11 +184,6 @@ class Core{ $nav_content=preg_replace("/\{logged_in\}(.*?)\{\/logged_in\}/si","",$nav_content); $nav_content=preg_replace("/\{logged_out\}(.*?)\{\/logged_out\}/si","\\1",$nav_content); } - if($session->userdata['allow_grimdark']!=0){ - $nav_content=preg_replace("/\{allow_gd\}(.*?)\{\/allow_gd\}/si","\\1",$nav_content); - }else{ - $nav_content=preg_replace("/\{allow_gd\}(.*?)\{\/allow_gd\}/si","",$nav_content); - } if(trim($nav_content)!=''){ $navtpl->assign('navtitle', $nav_title); @@ -301,6 +296,7 @@ class Core{ * */ function get_navbits(){ + $navs = ""; foreach($this->navbits as $key => $nav){ if(isset($this->navbits[$key+1])){ if($nav['url']==''){ @@ -316,7 +312,7 @@ class Core{ } } - if(!$navs){ + if(empty($navs)){ $navs=$bit; }else{ $navs.=' / '.$bit; @@ -442,11 +438,6 @@ class Core{ $row['content']=preg_replace("/\{logged_in\}(.*?)\{\/logged_in\}/si","",$row['content']); $row['content']=preg_replace("/\{logged_out\}(.*?)\{\/logged_out\}/si","\\1",$row['content']); } - if($session->userdata['allow_grimdark']!=0){ - $row['content']=preg_replace("/\{allow_gd\}(.*?)\{\/allow_gd\}/si","\\1",$row['content']); - }else{ - $row['content']=preg_replace("/\{allow_gd\}(.*?)\{\/allow_gd\}/si","",$row['content']); - } $content.=$row['content']; } } @@ -523,10 +514,14 @@ class Core{ * @return void * */ - - function make_page($content, $minimal=FALSE,$minimal_tpl='minimal_index.tpl',$header_tpl='header.tpl',$footer_tpl='footer.tpl'){ + function make_page($content, $minimal=FALSE,$minimal_tpl='minimal_index.tpl',$header_tpl='header.tpl',$footer_tpl='footer.tpl', $headers=array()){ global $config, $session, $start, $tpl, $db, $meta, $footer, $mod, $plugin,$plugin_content; $plugin->run_hook('frontpage_start',array(&$tpl)); + if(!empty($headers)){ + foreach($headers as $header){ + header($header['name'].": ".$header['value']); + } + } if($config['p3p_active']==1){ header('P3P: CP="'.$config['p3p_string'].'"'); } diff --git a/inc/datacache.class.php b/inc/datacache.class.php index ff4a3d2..79db417 100644 --- a/inc/datacache.class.php +++ b/inc/datacache.class.php @@ -24,7 +24,7 @@ $module["datacache"]["ver"]="0.1.0"; * @author Bernhard Jaud * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: ff4a3d2970d54373cf47e666f65314bf598c80d8 $ */ class datacache { diff --git a/inc/functions.class.php b/inc/functions.class.php index 03a0bb3..0dd0c7b 100644 --- a/inc/functions.class.php +++ b/inc/functions.class.php @@ -24,7 +24,7 @@ $module["functions"]["ver"]="1.0.1"; * @author Bernhard Jaud * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: 03a0bb3ba3c616ebb75bfcaa4a10268a9f2574d8 $ */ class functions { diff --git a/inc/lang.class.php b/inc/lang.class.php index 8929a00..6dac529 100644 --- a/inc/lang.class.php +++ b/inc/lang.class.php @@ -24,7 +24,7 @@ $module["lang"]["ver"]="0.1.2"; * @author Bernhard Jaud * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: 8929a005669603f570c7f7df5153236c9a460e56 $ */ diff --git a/inc/panel.class.php b/inc/panel.class.php index 77cdc16..941be8e 100644 --- a/inc/panel.class.php +++ b/inc/panel.class.php @@ -22,11 +22,11 @@ * @author Bernhard Jaud * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: 76d888c0933789da0c58b5cb3f1da854a9626f43 $ */ $module["panel"]["name"]="Panel Class"; -$module["panel"]["ver"]="0.3.6"; +$module["panel"]["ver"]="0.3.8"; class panel { var string $sidebar=""; var string $page=""; @@ -132,6 +132,7 @@ class panel { return $form; } } + function formClose ($return=FALSE) { @@ -156,7 +157,7 @@ class panel { function radio ($args=array(),$extra="",$return=FALSE) { - $name = $args["name"] ? $args["name"] : 'radiobutton'; + $name = $args["name"] ?? 'radiobutton'; $value = $args["value"]; if($value!=""){ $extra .= ' value="'.$value.'"'; @@ -191,9 +192,9 @@ class panel { function field ($args=array(),$extra="",$return=FALSE) { - $typ = $args["typ"] ? $args["typ"] : 'text'; - $name = $args["name"] ? $args["name"] : 'textfield'; - $value = $args["value"] ? $args["value"] : ''; + $typ = $args["typ"] ?? 'text'; + $name = $args["name"] ?? 'textfield'; + $value = $args["value"] ?? ''; $fld = ''; // html: form field if(!$return){ $this->content .= $fld; @@ -212,6 +213,101 @@ class panel { } } + function get_option($option,$name,$value="") { + + global $lang; + if($option=="yesno"){ + $checked["yes"]=""; + $checked["no"]=""; + if($value==1||$value==True||$value=="yes"){ + $checked["yes"]='checked="checked"'; + }else{ + $checked["no"]='checked="checked"'; + } + $yn=$this->radio(array("name"=>$name,"value"=>"1"),$checked["yes"],TRUE); + $yn.="Ja"; + $yn.=$this->radio(array("name"=>$name,"value"=>"0"),$checked["no"],TRUE); + $yn.="Nein"; + return $yn; + } + if($option=="onoff"){ + $checked["on"]=""; + $checked["off"]=""; + if($value==1||$value==True||$value=="on"){ + $checked["on"]='checked="checked"'; + }else{ + $checked["off"]='checked="checked"'; + } + $yn=$this->radio(array("name"=>$name,"value"=>"1"),$checked["on"],TRUE); + $yn.="An"; + $yn.=$this->radio(array("name"=>$name,"value"=>"0"),$checked["off"],TRUE); + $yn.="Aus"; + return $yn; + } + + if($option=="text"){ + $text=$this->field(array("name"=>$name,"typ"=>"text","value"=>$value),"",TRUE); + return $text; + } + + if(str_contains($option, "wysiwyg")){ + $string=str_replace("wysiwyg(","",substr($option, 0, -1)); + $sarr=explode(";",$string); + foreach($sarr as $str){ + $substr=explode("|",$str); + $a_name[]=$substr[0]; + $value[]=$substr[1]; + } + if(is_array($sarr)){ + $text=$this->textarea(array("name"=>$name,"value"=>$value, $a_name[0]=>$value[0],$a_name[1]=>$value[1]),"class=\"mceEditor\"",TRUE); + }else{ + $text=$this->textarea(array("name"=>$name,"value"=>$value),"class=\"mceEditor\"",TRUE); + } + return $text; + } + + if(str_contains($option, "textarea")){ + $string=str_replace("textarea(","",substr($option, 0, -1)); + $sarr=explode(";",$string); + if(count($sarr)>1) { + foreach ($sarr as $str) { + $substr = explode("|", $str); + $a_name[] = $substr[0]; + $value[] = $substr[1]; + } + $text=$this->textarea(array("name"=>$name,"value"=>$value, $a_name[0]=>$value[0],$a_name[1]=>$value[1]),"",TRUE); + }else{ + $text=$this->textarea(array("name"=>$name,"value"=>$value),"",TRUE); + } + return $text; + + } + + if($option=="language"){ + $values = array(); + $langs=$lang->getlanguages(); + foreach($langs as $lang){ + $values[$lang['name']]=$lang['short']; + } + return $this->select($values,$value,$name,"",TRUE); + } + + + if(str_contains($option, "select")){ + $string=str_replace("select(","",substr($option, 0, -1)); + $sarr=explode(";",$string); + $values=array(); + if(count($sarr)>1) { + foreach ($sarr as $str) { + $substr = explode("|", $str); + $values[$substr[0]] = $substr[1]; + } + } + return $this->select($values,$value,$name,"",TRUE); + } + + } + /* $args[value] used for default text (as in "field" function) */ diff --git a/inc/sessions.class.php b/inc/sessions.class.php index adce607..056c0a1 100644 --- a/inc/sessions.class.php +++ b/inc/sessions.class.php @@ -1,396 +1,396 @@ - - * @package BcWe core - * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ - */ -class session { - - var $sid = 0; - var $uid = 0; - var $ip = ''; - var $packip = ''; - var $userdata = array(); - var $useragent = ''; - - function page_begin($page = "UNDEFINED", $needlogin = TRUE){ - global $config, $db, $log, $core, $lang, $plugin, $functions; - $plugin->run_hook('page_begin_start',array('page'=>$page,'needlogin'=>$needlogin)); - if(!isset($this->userdata['uid']) || $this->userdata['uid']==0){ - $this->ip = $functions->get_ip(); - $this->packip = $functions->my_inet_pton($this->ip); - $this->useragent = $_SERVER["HTTP_USER_AGENT"]; - - //Check if the User has a Cookie - if (isset($_COOKIE[$config["cookiename"] . "_sid"])){ - //Retireve Data from Cookie - $sid = $_COOKIE[$config["cookiename"] . "_sid"]; - $sid = $db->escape(base64_decode($sid)); - $data = $db->fetch_array($db->query("SELECT sid,uid FROM `" . $config["prefix"] . "sessions` WHERE `sid`='".$sid."' AND `ip`=".$db->escape_binary($this->packip))); - - if($data['sid']){ - $this->sid=$data['sid']; - $this->uid=$data['uid']; - }else{ - $this->sid=0; - $this->uid=0; - } - } - - //Something's rotten. Still no SID. - if(!$this->sid){ - //This is some strange behavior, log it with low priority. - if($config["logging"]) - $log->write("SID not set.",5,__LINE__,__FILE__); - - $this->sid = 0; - $this->uid = 0; - } - - // If there is a Cookie log the user in (if he isn't already) - if (isset($_COOKIE[$config["cookiename"] . "_base"])){ - $cookiedata = $_COOKIE[$config["cookiename"] . "_base"]; - $cookiedata = explode("_",base64_decode($cookiedata),2); - $this->load_data($cookiedata[0],$cookiedata[1]); - } - - if($this->userdata['active']==2){ - $additional_message = ''; - if($this->userdata['bio']!=""){ - $additional_message = '
    '.$lang->_('REASON').' '.$this->userdata['bio']; - } - //$this->destroy_session($session->sid); - - $this->userdata['uid']=0; - - $this->setcookie($config['cookiename'] . '_base', 0, time()-3600, $config['path'],$config['domain']); - $core->message($lang->_('BANNED'),$lang->_('YOUHAVEBEENBANNED').$additional_message); - } - - // Still no Userdata, its a Guest - if(!isset($this->userdata['uid'])){ - if(!empty($this->sid)){ - $this->update_session($this->sid); - $this->userdata['uid']=0; - }else{ - $this->create_session(); - $this->userdata['uid']=0; - } - } - - $this->setcookie($config["cookiename"] . "_sid",base64_encode($this->sid),0,"/",$config['domain'],true); - } - $plugin->run_hook('page_begin_end',array('data'=>$this)); - - - if($needlogin != FALSE && $this->userdata["uid"]==0){ - header("LOCATION://" . $_SERVER["HTTP_HOST"] . $config['path'] . "/index.php?fail=needlogin"); - } - } - - //Fetch userdata - function load_data($uid, $loginkey){ - global $db,$config, $log, $plugin, $lang; - - $plugin->run_hook('load_data_start',array('loginkey'=>$loginkey,'uid'=>$uid, 'data'=>$this)); - $result = $db->query("SELECT * FROM `" . $config["prefix"] . "users` u LEFT JOIN `" . $config["prefix"] . "role` r ON r.id=u.role WHERE u.`uid`='" . intval($uid) . "' and u.`loginkey`='" . $db->escape($loginkey) . "' LIMIT 1"); - $this->userdata=$db->fetch_array($result); - $result = $db->query("SELECT * FROM `" . $config["prefix"] . "roleset` rs LEFT JOIN `" . $config["prefix"] . "role_values` rv ON rv.id=rs.role_value_id WHERE rs.role_id='".$this->userdata["role"]."'"); - - while($row=$db->fetch_array($result)){ - $this->userdata[$row["name"]]=$row["value"]; - } - if(!$this->userdata['uid']){ - - if($config["logging"]) - $log->write("No User found. UID: " .$uid,4,__LINE__,__FILE__); - - unset($this->userdata); - $this->uid=0; - return false; - } - - if($uid!=$this->userdata['uid'] || $loginkey!=$this->userdata['loginkey']){ - - if($config["logging"]){ - $log->write("HACK ATTEMPT. Cookie Spoof. UID: " .$uid,1,__LINE__,__FILE__); - } - unset($this->userdata); - $this->uid=0; - return false; - } - if($this->userdata['uid']!=0){ - if($this->userdata['lastip'] != $this->packip && array_key_exists('lastip', $this->userdata)){ - $lastip_add = ", lastip=".$db->escape_binary($this->packip); - } - else - { - $lastip_add = ''; - } - - $time = time(); - if($time - $this->userdata['lastactive'] > 900){ - $db->query("UPDATE `" . $config["prefix"] . "users` SET `lastvisit`='" . $this->userdata['lastactive'] . "', `lastactive`='" . $time . "'".$lastip_add." WHERE `uid`='" . $uid . "'"); - //$mybb->user['lastvisit'] = $mybb->user['lastactive']; - } - else - { - $timespent = $time - $this->userdata['lastactive']; - $db->query("UPDATE `" . $config["prefix"] . "users` SET `lastactive`='" . $time . "'".$lastip_add." WHERE `uid`='" . $uid . "'"); - } - } - if(!empty($this->sid)){ - $this->update_session($this->sid, $this->userdata['uid']); - }else{ - $this->create_session($this->userdata['uid']); - } - $lang->setlang($this->userdata['lang']); - $plugin->run_hook('load_data_end',array('data'=>$this)); - } - - function setcookie($name,$data,$validto=0,$path=NULL,$domain=NULL,$httponly=false,$https=true) - { - if($domain!=''){ - // Fix the domain to accept domains with and without 'www.'. - if (strtolower( substr($domain, 0, 4) ) == 'www.' ){ - $domain = substr($domain, 4); - }else{ - $domain = $domain; - } - // Add the dot prefix to ensure compatibility with subdomains - if ( substr($domain, 0, 1) != '.' ){ - $domain = '.'.$domain; - } - } - if((isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS'])) || $https){ - $https = true; - } - $arr_cookie_options = array ( - 'expires' => $validto, - 'path' => $path, - 'domain' => $domain, // leading dot for compatibility or use subdomain - 'secure' => $https, // or false - 'httponly' => $httponly, // or false - 'samesite' => 'Strict' // None || Lax || Strict - ); - setcookie($name, $data, $arr_cookie_options); - } - - function update_session($sid, $uid=''){ - global $db,$config, $plugin, $lang; - $plugin->run_hook('update_session_start', array('sid'=>$sid,'uid'=>$uid, 'data'=>$this)); - if($uid){ - $sessiondata['uid'] = $uid; - $db->query("UPDATE `" . $config["prefix"] . "users` SET `lastvisit`='".time()."' WHERE `uid`='".$uid."'"); - }else{ - $sessiondata['uid'] = 0; - $lang->setlang($config['lang']); - } - - $sid = $db->escape($sid); - $db->query("UPDATE `" . $config["prefix"] . "sessions` SET `uid`='".$sessiondata['uid']."',`time`='".time()."',`ip`=".$db->escape_binary($this->packip).", `useragent`='".$db->escape($this->useragent)."' WHERE `sid`='".$sid."'"); - $timeout=time()-1800; - $db->query("DELETE FROM `" . $config["prefix"] . "sessions` WHERE `time`<='".$timeout."'"); - $plugin->run_hook('update_session_end'); - } - - function create_session($uid=0){ - global $db,$config, $plugin, $lang, $functions; - $plugin->run_hook('create_session_start', array('uid'=>$uid, 'data'=>$this)); - if($uid > 0){ - $db->query("DELETE FROM `" . $config["prefix"] . "sessions` WHERE `uid`='".intval($uid)."'"); - $sessiondata['uid'] = $uid; - }else{ - $db->query("DELETE FROM `" . $config["prefix"] . "sessions` WHERE `ip`=".$db->escape_binary($this->packip)); - $sessiondata['uid'] = 0; - $lang->setlang($config['lang']); - } - - $sessiondata['sid'] = md5($functions->random_str(50)); - $db->query("INSERT INTO `" . $config["prefix"] . "sessions` (`sid`,`uid`,`time`,`useragent`,`ip`) VALUES ('".$sessiondata['sid']."','".$sessiondata['uid']."','".time()."','".$db->escape($this->useragent)."',".$db->escape_binary($this->packip).")"); - $db->query("UPDATE `" . $config["prefix"] . "users` SET `lastvisit`='".time()."' WHERE `uid`='".$uid."'"); - $this->sid = $sessiondata['sid']; - $this->uid = $sessiondata['uid']; - $plugin->run_hook('create_session_end'); - } - - function destroy_session($sid) - { - global $db,$config, $plugin; - $plugin->run_hook('destroy_session_start', array('data'=>$this)); - if($sid !=""){ - $db->query("DELETE FROM `" . $config["prefix"] . "sessions` WHERE `sid`='".$db->escape($sid)."'"); - }else{ - $db->query("DELETE FROM `" . $config["prefix"] . "sessions` WHERE `ip`=".$db->escape_binary($this->packip)); - } - unset($this->userdata); - $this->setcookie($config["cookiename"] . '_sid','',-3600,'/',true); - $this->sid = 0; - $this->uid = 0; - $plugin->run_hook('destroy_session_end'); - } - - function check_login($username='',$password='',$openid='') - { - global $db,$config, $plugin, $lang, $core; - $plugin->run_hook('check_login_start', array('data'=>$this)); - if($username!='' && $password!=''){ - $username = $db->escape($username); - $result = $db->query("SELECT `uid`,`salt` FROM `" . $config['prefix'] . "users` WHERE `username` LIKE '".$username."' AND `active`>'0' LIMIT 1"); - if ($db->num_rows ($result) > 0){ - // There is a user - $data=$db->fetch_array($result); - }else{ - return false; - } - $pass = hash('sha256',$db->escape($data['salt'].$password)); - $result = $db->query("SELECT `uid`,`loginkey`,`active`,`bio` FROM `" . $config['prefix'] . "users` WHERE `username` LIKE '".$username."' AND `password`='".$pass."' AND `active`>'0' LIMIT 1"); - if ($db->num_rows ($result) > 0){ - // There is a user - $data=$db->fetch_array($result); - }else{ - return false; - } - if($data['active']==2){ - $additional_message = ''; - if($data['bio']!=""){ - $additional_message = '
    '.$lang->_('REASON').' '.$data['bio']; - } - unset($data); - - $this->setcookie($config['cookiename'] . '_base', 0, time()-3600, $config['path'],$config['domain']); - $core->message($lang->_('BANNED'),$lang->_('YOUHAVEBEENBANNED').$additional_message); - return 'BANNED'; - } - $uid = $data['uid']; - $key = $data['loginkey']; - $this->login($uid,$key); - return $uid; - }elseif($openid!=''){ - $identity=$db->escape($openid); - $result = $db->query("SELECT `uid`,`loginkey` FROM `" . $config['prefix'] . "users` WHERE `openid_identity` = '".$identity."' AND `active`='1' LIMIT 1"); - if ($db->num_rows ($result) > 0){ - // There is a user - $data=$db->fetch_array($result); - }else{ - return false; - } - $uid = $data['uid']; - $key = $data['loginkey']; - $this->login($uid,$key); - return $uid; - }else{ - return false; - } - } - - function login($uid,$key) - { - global $db,$config, $plugin; - $plugin->run_hook('logon_start', array('data'=>$this)); - $cookiedata['uid'] = $uid; - $cookiedata['loginkey'] = $key; - $cookiedata = base64_encode($cookiedata['uid'] .'_'. $cookiedata['loginkey']); - if(isset($_POST['remember']) && $_POST['remember']){ - $this->setcookie($config['cookiename'] . '_base', $cookiedata, time() + 60 * 60 * 24 * 365, $config['path'],$config['domain'],true); - }else{ - $this->setcookie($config['cookiename'] . '_base', $cookiedata, 0, $config['path'],$config['domain'],true); - } - $this->create_session($uid); - $plugin->run_hook('logon_end'); - } - - function get_users_with_right($right, $value) - { - global $db,$config; - $result = $db->query("SELECT u.* FROM `" . $config["prefix"] . "users` u LEFT JOIN `" . $config["prefix"] . "role` r ON u.`role`=r.`id` LEFT JOIN `" . $config["prefix"] . "roleset` rs ON rs.`role_id`=r.`id` LEFT JOIN `" . $config["prefix"] . "role_values` rv ON rv.`id`=rs.`role_value_id` WHERE rv.`name`='".$db->escape($right)."' AND rs.`value`='".$db->escape($value)."'"); - while($row=$db->fetch_array($result)){ - $return[]=$row; - } - return $return; - } - - function generate_Key($length=8){ - - $dummy = array_merge(range('0', '9'), range('a', 'z'), range('A', 'Z')); - - mt_srand((double)microtime()*1000000); - - for ($i = 1; $i <= (count($dummy)*2); $i++){ - $swap = mt_rand(0,count($dummy)-1); - $tmp = $dummy[$swap]; - $dummy[$swap] = $dummy[0]; - $dummy[0] = $tmp; - } - - return substr(implode('',$dummy),0,$length); - - } - - function sanitize_username($username){ - global $config; - $username = trim($username); - $username = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $username); - $username = str_replace(array(chr(160), chr(173), chr(0xCA), chr(8238), chr(8237), chr(8203),"]","[","/","\\"), array("", "-", "", "", "", "","","","",""), $username); - // Remove multiple spaces from the username - $username = preg_replace("#\s{2,}#", "", $username); - return $username; - } - - function verify_username($username){ - global $config; - - // Check if the username is not empty. - if($username == '') - { - return "Username empty."; - } - - // Check if the username belongs to the list of banned usernames. - $banned=explode("\n",$config['banned_usernames']); - if(is_array($banned)){ - foreach($banned as $banned_username){ - $banned_username = str_replace('*', '(.*)', trim($banned_username)); - if(preg_match("#\b{$banned_username}\b#i", $username)){ - return "Forbidden Username:".$banned_username; - } - } - } - // Check for certain characters in username (<, >, &, commas and slashes) - if(strpos($username, ".") !== false || strpos($username, ":") !== false || strpos($username, " ") !== false || strpos($username, "<") !== false || strpos($username, ">") !== false || strpos($username, "&") !== false || strpos($username, ")") !== false || strpos($username, "(") !== false || strpos($username, "\\") !== false || strpos($username, ";") !== false || strpos($username, ",") !== false || strpos($username, "~") !== false) - { - return "Forbidden Chars in Username"; - } - - // Check if the username is of the correct length. - if(($config['maxnamelength'] != 0 && strlen($username) > $config['maxnamelength']) || ($config['minnamelength'] != 0 && strlen($username) < $config['minnamelength'])) - { - return sprintf('The username must be %s Chars minimum and can be %s Chars long at max.',$config['minnamelength'],$config['maxnamelength']); - } - - return true; - } -} -?> + + * @package BcWe core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: 443eb9470db48f9529ee24146530d1742a019fb4 $ + */ +class session { + + var $sid = 0; + var $uid = 0; + var $ip = ''; + var $packip = ''; + var $userdata = array(); + var $useragent = ''; + + function page_begin($page = "UNDEFINED", $needlogin = TRUE){ + global $config, $db, $log, $core, $lang, $plugin, $functions; + $plugin->run_hook('page_begin_start',array('page'=>$page,'needlogin'=>$needlogin)); + if(!isset($this->userdata['uid']) || $this->userdata['uid']==0){ + $this->ip = $functions->get_ip(); + $this->packip = $functions->my_inet_pton($this->ip); + $this->useragent = $_SERVER["HTTP_USER_AGENT"]; + + //Check if the User has a Cookie + if (isset($_COOKIE[$config["cookiename"] . "_sid"])){ + //Retireve Data from Cookie + $sid = $_COOKIE[$config["cookiename"] . "_sid"]; + $sid = $db->escape(base64_decode($sid)); + $data = $db->fetch_array($db->query("SELECT sid,uid FROM `" . $config["prefix"] . "sessions` WHERE `sid`='".$sid."' AND `ip`=".$db->escape_binary($this->packip))); + + if($data['sid']){ + $this->sid=$data['sid']; + $this->uid=$data['uid']; + }else{ + $this->sid=0; + $this->uid=0; + } + } + + //Something's rotten. Still no SID. + if(!$this->sid){ + //This is some strange behavior, log it with low priority. + if($config["logging"]) + $log->write("SID not set.",5,__LINE__,__FILE__); + + $this->sid = 0; + $this->uid = 0; + } + + // If there is a Cookie log the user in (if he isn't already) + if (isset($_COOKIE[$config["cookiename"] . "_base"])){ + $cookiedata = $_COOKIE[$config["cookiename"] . "_base"]; + $cookiedata = explode("_",base64_decode($cookiedata),2); + $this->load_data($cookiedata[0],$cookiedata[1]); + } + + if($this->userdata['active']==2){ + $additional_message = ''; + if($this->userdata['bio']!=""){ + $additional_message = '
    '.$lang->_('REASON').' '.$this->userdata['bio']; + } + //$this->destroy_session($session->sid); + + $this->userdata['uid']=0; + + $this->setcookie($config['cookiename'] . '_base', 0, time()-3600, $config['path'],$config['domain']); + $core->message($lang->_('BANNED'),$lang->_('YOUHAVEBEENBANNED').$additional_message); + } + + // Still no Userdata, its a Guest + if(!isset($this->userdata['uid'])){ + if(!empty($this->sid)){ + $this->update_session($this->sid); + $this->userdata['uid']=0; + }else{ + $this->create_session(); + $this->userdata['uid']=0; + } + } + + $this->setcookie($config["cookiename"] . "_sid",base64_encode($this->sid),0,"/",$config['domain'],true); + } + $plugin->run_hook('page_begin_end',array('data'=>$this)); + + + if($needlogin != FALSE && $this->userdata["uid"]==0){ + header("LOCATION://" . $_SERVER["HTTP_HOST"] . $config['path'] . "/index.php?fail=needlogin"); + } + } + + //Fetch userdata + function load_data($uid, $loginkey){ + global $db,$config, $log, $plugin, $lang; + + $plugin->run_hook('load_data_start',array('loginkey'=>$loginkey,'uid'=>$uid, 'data'=>$this)); + $result = $db->query("SELECT * FROM `" . $config["prefix"] . "users` u LEFT JOIN `" . $config["prefix"] . "role` r ON r.id=u.role WHERE u.`uid`='" . intval($uid) . "' and u.`loginkey`='" . $db->escape($loginkey) . "' LIMIT 1"); + $this->userdata=$db->fetch_array($result); + $result = $db->query("SELECT * FROM `" . $config["prefix"] . "roleset` rs LEFT JOIN `" . $config["prefix"] . "role_values` rv ON rv.id=rs.role_value_id WHERE rs.role_id='".$this->userdata["role"]."'"); + + while($row=$db->fetch_array($result)){ + $this->userdata[$row["name"]]=$row["value"]; + } + if(!$this->userdata['uid']){ + + if($config["logging"]) + $log->write("No User found. UID: " .$uid,4,__LINE__,__FILE__); + + unset($this->userdata); + $this->uid=0; + return false; + } + + if($uid!=$this->userdata['uid'] || $loginkey!=$this->userdata['loginkey']){ + + if($config["logging"]){ + $log->write("HACK ATTEMPT. Cookie Spoof. UID: " .$uid,1,__LINE__,__FILE__); + } + unset($this->userdata); + $this->uid=0; + return false; + } + if($this->userdata['uid']!=0){ + if($this->userdata['lastip'] != $this->packip && array_key_exists('lastip', $this->userdata)){ + $lastip_add = ", lastip=".$db->escape_binary($this->packip); + } + else + { + $lastip_add = ''; + } + + $time = time(); + if($time - $this->userdata['lastactive'] > 900){ + $db->query("UPDATE `" . $config["prefix"] . "users` SET `lastvisit`='" . $this->userdata['lastactive'] . "', `lastactive`='" . $time . "'".$lastip_add." WHERE `uid`='" . $uid . "'"); + //$mybb->user['lastvisit'] = $mybb->user['lastactive']; + } + else + { + $timespent = $time - $this->userdata['lastactive']; + $db->query("UPDATE `" . $config["prefix"] . "users` SET `lastactive`='" . $time . "'".$lastip_add." WHERE `uid`='" . $uid . "'"); + } + } + if(!empty($this->sid)){ + $this->update_session($this->sid, $this->userdata['uid']); + }else{ + $this->create_session($this->userdata['uid']); + } + $lang->setlang($this->userdata['lang']); + $plugin->run_hook('load_data_end',array('data'=>$this)); + } + + function setcookie($name,$data,$validto=0,$path=NULL,$domain=NULL,$httponly=false,$https=true) + { + if($domain!=''){ + // Fix the domain to accept domains with and without 'www.'. + if (strtolower( substr($domain, 0, 4) ) == 'www.' ){ + $domain = substr($domain, 4); + }else{ + $domain = $domain; + } + // Add the dot prefix to ensure compatibility with subdomains + if ( substr($domain, 0, 1) != '.' ){ + $domain = '.'.$domain; + } + } + if((isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS'])) || $https){ + $https = true; + } + $arr_cookie_options = array ( + 'expires' => $validto, + 'path' => $path, + 'domain' => $domain, // leading dot for compatibility or use subdomain + 'secure' => $https, // or false + 'httponly' => $httponly, // or false + 'samesite' => 'Strict' // None || Lax || Strict + ); + setcookie($name, $data, $arr_cookie_options); + } + + function update_session($sid, $uid=''){ + global $db,$config, $plugin, $lang; + $plugin->run_hook('update_session_start', array('sid'=>$sid,'uid'=>$uid, 'data'=>$this)); + if($uid){ + $sessiondata['uid'] = $uid; + $db->query("UPDATE `" . $config["prefix"] . "users` SET `lastvisit`='".time()."' WHERE `uid`='".$uid."'"); + }else{ + $sessiondata['uid'] = 0; + $lang->setlang($config['lang']); + } + + $sid = $db->escape($sid); + $db->query("UPDATE `" . $config["prefix"] . "sessions` SET `uid`='".$sessiondata['uid']."',`time`='".time()."',`ip`=".$db->escape_binary($this->packip).", `useragent`='".$db->escape($this->useragent)."' WHERE `sid`='".$sid."'"); + $timeout=time()-1800; + $db->query("DELETE FROM `" . $config["prefix"] . "sessions` WHERE `time`<='".$timeout."'"); + $plugin->run_hook('update_session_end'); + } + + function create_session($uid=0){ + global $db,$config, $plugin, $lang, $functions; + $plugin->run_hook('create_session_start', array('uid'=>$uid, 'data'=>$this)); + if($uid > 0){ + $db->query("DELETE FROM `" . $config["prefix"] . "sessions` WHERE `uid`='".intval($uid)."'"); + $sessiondata['uid'] = $uid; + }else{ + $db->query("DELETE FROM `" . $config["prefix"] . "sessions` WHERE `ip`=".$db->escape_binary($this->packip)); + $sessiondata['uid'] = 0; + $lang->setlang($config['lang']); + } + + $sessiondata['sid'] = md5($functions->random_str(50)); + $db->query("INSERT INTO `" . $config["prefix"] . "sessions` (`sid`,`uid`,`time`,`useragent`,`ip`) VALUES ('".$sessiondata['sid']."','".$sessiondata['uid']."','".time()."','".$db->escape($this->useragent)."',".$db->escape_binary($this->packip).")"); + $db->query("UPDATE `" . $config["prefix"] . "users` SET `lastvisit`='".time()."' WHERE `uid`='".$uid."'"); + $this->sid = $sessiondata['sid']; + $this->uid = $sessiondata['uid']; + $plugin->run_hook('create_session_end'); + } + + function destroy_session($sid) + { + global $db,$config, $plugin; + $plugin->run_hook('destroy_session_start', array('data'=>$this)); + if($sid !=""){ + $db->query("DELETE FROM `" . $config["prefix"] . "sessions` WHERE `sid`='".$db->escape($sid)."'"); + }else{ + $db->query("DELETE FROM `" . $config["prefix"] . "sessions` WHERE `ip`=".$db->escape_binary($this->packip)); + } + unset($this->userdata); + $this->setcookie($config["cookiename"] . '_sid','',-3600,'/',true); + $this->sid = 0; + $this->uid = 0; + $plugin->run_hook('destroy_session_end'); + } + + function check_login($username='',$password='',$openid='') + { + global $db,$config, $plugin, $lang, $core; + $plugin->run_hook('check_login_start', array('data'=>$this)); + if($username!='' && $password!=''){ + $username = $db->escape($username); + $result = $db->query("SELECT `uid`,`salt` FROM `" . $config['prefix'] . "users` WHERE `username` LIKE '".$username."' AND `active`>'0' LIMIT 1"); + if ($db->num_rows ($result) > 0){ + // There is a user + $data=$db->fetch_array($result); + }else{ + return false; + } + $pass = hash('sha256',$db->escape($data['salt'].$password)); + $result = $db->query("SELECT `uid`,`loginkey`,`active`,`bio` FROM `" . $config['prefix'] . "users` WHERE `username` LIKE '".$username."' AND `password`='".$pass."' AND `active`>'0' LIMIT 1"); + if ($db->num_rows ($result) > 0){ + // There is a user + $data=$db->fetch_array($result); + }else{ + return false; + } + if($data['active']==2){ + $additional_message = ''; + if($data['bio']!=""){ + $additional_message = '
    '.$lang->_('REASON').' '.$data['bio']; + } + unset($data); + + $this->setcookie($config['cookiename'] . '_base', 0, time()-3600, $config['path'],$config['domain']); + $core->message($lang->_('BANNED'),$lang->_('YOUHAVEBEENBANNED').$additional_message); + return 'BANNED'; + } + $uid = $data['uid']; + $key = $data['loginkey']; + $this->login($uid,$key); + return $uid; + }elseif($openid!=''){ + $identity=$db->escape($openid); + $result = $db->query("SELECT `uid`,`loginkey` FROM `" . $config['prefix'] . "users` WHERE `openid_identity` = '".$identity."' AND `active`='1' LIMIT 1"); + if ($db->num_rows ($result) > 0){ + // There is a user + $data=$db->fetch_array($result); + }else{ + return false; + } + $uid = $data['uid']; + $key = $data['loginkey']; + $this->login($uid,$key); + return $uid; + }else{ + return false; + } + } + + function login($uid,$key) + { + global $db,$config, $plugin; + $plugin->run_hook('logon_start', array('data'=>$this)); + $cookiedata['uid'] = $uid; + $cookiedata['loginkey'] = $key; + $cookiedata = base64_encode($cookiedata['uid'] .'_'. $cookiedata['loginkey']); + if(isset($_POST['remember']) && $_POST['remember']){ + $this->setcookie($config['cookiename'] . '_base', $cookiedata, time() + 60 * 60 * 24 * 365, $config['path'],$config['domain'],true); + }else{ + $this->setcookie($config['cookiename'] . '_base', $cookiedata, 0, $config['path'],$config['domain'],true); + } + $this->create_session($uid); + $plugin->run_hook('logon_end'); + } + + function get_users_with_right($right, $value) + { + global $db,$config; + $result = $db->query("SELECT u.* FROM `" . $config["prefix"] . "users` u LEFT JOIN `" . $config["prefix"] . "role` r ON u.`role`=r.`id` LEFT JOIN `" . $config["prefix"] . "roleset` rs ON rs.`role_id`=r.`id` LEFT JOIN `" . $config["prefix"] . "role_values` rv ON rv.`id`=rs.`role_value_id` WHERE rv.`name`='".$db->escape($right)."' AND rs.`value`='".$db->escape($value)."'"); + while($row=$db->fetch_array($result)){ + $return[]=$row; + } + return $return; + } + + function generate_Key($length=8){ + + $dummy = array_merge(range('0', '9'), range('a', 'z'), range('A', 'Z')); + + mt_srand((double)microtime()*1000000); + + for ($i = 1; $i <= (count($dummy)*2); $i++){ + $swap = mt_rand(0,count($dummy)-1); + $tmp = $dummy[$swap]; + $dummy[$swap] = $dummy[0]; + $dummy[0] = $tmp; + } + + return substr(implode('',$dummy),0,$length); + + } + + function sanitize_username($username){ + global $config; + $username = trim($username); + $username = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $username); + $username = str_replace(array(chr(160), chr(173), chr(0xCA), chr(8238), chr(8237), chr(8203),"]","[","/","\\"), array("", "-", "", "", "", "","","","",""), $username); + // Remove multiple spaces from the username + $username = preg_replace("#\s{2,}#", "", $username); + return $username; + } + + function verify_username($username){ + global $config; + + // Check if the username is not empty. + if($username == '') + { + return "Username empty."; + } + + // Check if the username belongs to the list of banned usernames. + $banned=explode("\n",$config['banned_usernames']); + if(is_array($banned)){ + foreach($banned as $banned_username){ + $banned_username = str_replace('*', '(.*)', trim($banned_username)); + if(preg_match("#\b{$banned_username}\b#i", $username)){ + return "Forbidden Username:".$banned_username; + } + } + } + // Check for certain characters in username (<, >, &, commas and slashes) + if(strpos($username, ".") !== false || strpos($username, ":") !== false || strpos($username, " ") !== false || strpos($username, "<") !== false || strpos($username, ">") !== false || strpos($username, "&") !== false || strpos($username, ")") !== false || strpos($username, "(") !== false || strpos($username, "\\") !== false || strpos($username, ";") !== false || strpos($username, ",") !== false || strpos($username, "~") !== false) + { + return "Forbidden Chars in Username"; + } + + // Check if the username is of the correct length. + if(($config['maxnamelength'] != 0 && strlen($username) > $config['maxnamelength']) || ($config['minnamelength'] != 0 && strlen($username) < $config['minnamelength'])) + { + return sprintf('The username must be %s Chars minimum and can be %s Chars long at max.',$config['minnamelength'],$config['maxnamelength']); + } + + return true; + } +} +?> diff --git a/logs/.gitignore b/logs/.gitignore new file mode 100644 index 0000000..397b4a7 --- /dev/null +++ b/logs/.gitignore @@ -0,0 +1 @@ +*.log diff --git a/modules/ajaxpm/admin/add.apnl.php b/modules/ajaxpm/admin/add.apnl.php new file mode 100644 index 0000000..498fb7e --- /dev/null +++ b/modules/ajaxpm/admin/add.apnl.php @@ -0,0 +1,142 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: add.apnl.php 96 2010-02-17 21:56:41Z genuineparts $ +*/ +If (!defined("in_BL_ADMIN")) { + die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); +} +$session->page_begin("add News", True); + +class add_news_panel extends admin_module{ + + function output(){ + global $config, $db,$panel, $session; + $fail=FALSE; + if(isset($_POST['send'])&& $_POST['send']==1){ + if(isset($_POST['text'])&& $_POST['text']!=""||isset($_POST['title'])&& $_POST['title']!=""){ + $title=$db->escape($_POST['title']); + $db->query("INSERT INTO `" . $config["prefix"] . "news` (`text`,`date`,`author`,`category`,`title`,`active`) VALUES ('".$db->escape($_POST["text"])."','".time()."','".$session->userdata["uid"]."','".intval($_POST["category"])."','".$title."','".$_POST["active"]."')"); + $panel->admin_message("Danke", "Die News wurden erfolgreich eingetragen!.",TRUE,"add_news"); + }else{ + $fail="Du musst alle Felder ausfüllen!"; + } + }elseif(!isset($_POST['send']) || $fail){ + $panel->title="News schreiben"; + $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=add_news")); + if($fail){ + $panel->content.=$fail; + } + $panel->content.="

    Titel:

    "; + $panel->field(array("name"=>"title","typ"=>"text","value"=>$_POST["title"])); + $resultc=$db->query("SELECT `id`,`name` FROM `" . $config["prefix"] . "news_category` WHERE `active`='true'"); + $karray["Keine"]=""; + while($row=$db->fetch_array($resultc)){ + $karray[$row["name"]]=$row["id"]; + } + $panel->content.="

    Kategorie:

    "; + $panel->select($karray,$_POST["category"],"category"); + $panel->content.="
    "; + $panel->content.="

    Text:

    "; + $panel->textarea(array("name"=>"text","value"=>$_POST["text"],"rows"=>"30","cols"=>"80"),"class=\"mceEditor\""); + $panel->content.="

    Aktiv:

    "; + $panel->select(array("Nein"=>"false","Ja"=>"true"),$_POST["active"],"active"); + $panel->content.="
    "; + $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); + $panel->content.="
    "; + $panel->submit(); + $panel->formClose(); + } + } + + function meta(){ + global $config; + $meta=" + "; + $meta.=' + + + '; + return $meta; + } +} +?> \ No newline at end of file diff --git a/modules/ajaxpm/admin/addcategory.apnl.php b/modules/ajaxpm/admin/addcategory.apnl.php new file mode 100644 index 0000000..21978eb --- /dev/null +++ b/modules/ajaxpm/admin/addcategory.apnl.php @@ -0,0 +1,81 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: addcategory.apnl.php 96 2010-02-17 21:56:41Z genuineparts $ +*/ + +If (!defined("in_BL_ADMIN")) { + die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); +} +$session->page_begin("add news Category", True); + +class addcategory_news_panel extends admin_module{ + + function output(){ + global $config, $db,$panel, $root, $session, $core; + $fail=FALSE; + if(isset($_POST['send'])&& $_POST['send']==1){ + if(isset($_POST['name'])&& $_POST['name']!=""){ + $userfile_name = $_FILES['picture']['name']; + $userfile_tmp = $_FILES['picture']['tmp_name']; + $userfile_size = $_FILES['picture']['size']; + $userfile_type = $_FILES['picture']['type']; + $filedir = $root.'/newsimages/'; + $size = 120; + if (isset($_FILES['picture']['name']) && $_FILES['picture']['name']!=""){ + $prod_img = $filedir.$userfile_name; + $ret=$core->upload_file($prod_img, $userfile_tmp, $size, $size, TRUE, TRUE); + if($ret!==TRUE){ + $panel->admin_message("Fehler", "Das Bild konnte nicht hochgeladen wrden
    Der Fehler war: ". $ret,TRUE,"addcategory_news"); + } + } + $name=$db->escape($_POST['name']); + $active=$db->escape($_POST['active']); + $db->query("INSERT INTO `" . $config["prefix"]. "news_category` (`name`,`picture`,`active`) VALUES ('".$name."','".$userfile_name."','".$active."')"); + $panel->admin_message("Danke", "Die Kategorie wurde erfolgreich eingetragen!.",TRUE,"addcategory_news"); + }else{ + $fail="Der Kategoriename muss angegeben werden!"; + } + }elseif(!isset($_POST['send']) || $fail){ + $panel->title="Kategorie hinzufügen"; + $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=addcategory_news"),FALSE,"enctype=\"multipart/form-data\""); + if($fail){ + $panel->content.=$fail; + } + $panel->content.="

    Kategoriename:

    "; + $panel->field(array("name"=>"name","typ"=>"text","value"=>$_POST["name"])); + $panel->content.="

    Kategoriebild:

    "; + $panel->field(array("name"=>"picture","typ"=>"file","value"=>$_POST["picture"])); + $panel->content.="
    "; + $panel->content.="

    Aktiv:

    "; + $panel->select(array("Nein"=>"false","Ja"=>"true"),$_POST["active"],"active"); + $panel->content.="
    "; + $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); + $panel->content.="
    "; + $panel->submit(); + $panel->formClose(); + } + } +} +?> \ No newline at end of file diff --git a/modules/ajaxpm/admin/edit.apnl.php b/modules/ajaxpm/admin/edit.apnl.php new file mode 100644 index 0000000..84afac5 --- /dev/null +++ b/modules/ajaxpm/admin/edit.apnl.php @@ -0,0 +1,227 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: edit.apnl.php 96 2010-02-17 21:56:41Z genuineparts $ +*/ +If (!defined('in_BL_ADMIN')) { + die('Dieses Script kann nicht ausserhalb des Frameworks laufen!'); +} +$session->page_begin('edit News', True); + +class edit_news_panel extends admin_module{ + + function output(){ + global $config, $db,$panel, $session, $admin; + $fail=FALSE; + if(isset($_POST['send'])&& $_POST['send']==1){ + if(isset($_POST['id'])&& $_POST['id']!=''||isset($_POST['text'])&& $_POST['text']!=''||isset($_POST['title'])&& $_POST['title']!=''){ + $id=intval($_POST['id']); + $title=$db->escape($_POST['title']); + $db->query("UPDATE `" . $config['prefix'] . "news` SET `text`='".$db->escape($_POST['text'])."',`category`='".intval($_POST['category'])."',`title`='".$title."',`active`='".$_POST['active']."' WHERE `id`='".$id."'"); + $panel->admin_message('Danke', 'News erfolgreich geändert!',TRUE,'edit_news'); + }else{ + $fail='Du musst alle Felder ausfüllen!'; + } + + }elseif(isset($_GET['id'])&& $_GET['id']!=''){ + if($_GET['action']=='edit'){ + $result = $db->query("SELECT * FROM " . $config['prefix'] . "news WHERE id='".intval($_GET['id'])."'"); + $_POST=$db->fetch_array($result); + + /*$resultna=$db->query("SELECT id,name FROM " . $config["prefix"] . "menue"); + while($rowa=$db->fetch_array($resultna)){ + $resultn = $db->query("SELECT m_id FROM " . $config["prefix"] . "article_menue WHERE a_id='".intval($_GET['id'])."' and m_id='".$rowa["id"]."'"); + if($db->num_rows($resultn) >= 1){ + $rowa["checked"]="checked=\"checked\""; + } + $navs[]=$rowa; + }*/ + + + $panel->title='News editieren'; + $panel->form(array('action'=>$config['path'].'/admin/index.php?panel=edit_news')); + if($fail){ + $panel->content.=$fail; + } + $panel->content.='

    Titel:

    '; + $panel->field(array('name'=>'title','typ'=>'text','value'=>$_POST['title'])); + $panel->content.='

    Kategorie:

    '; + $resultc=$db->query("SELECT `id`,`name` FROM `" . $config['prefix'] . "news_category` WHERE `active`='true'"); + $karray['Keine']=''; + while($row=$db->fetch_array($resultc)){ + $karray[$row['name']]=$row['id']; + } + $panel->select($karray,$_POST['category'],'category'); + $panel->content.='

    Text:

    '; + $panel->textarea(array('name'=>'text','value'=>$_POST['text'],'rows'=>'30','cols'=>'80'),'class="mceEditor"'); + $panel->content.='

    Aktiv:

    '; + $panel->select(array('Nein'=>'false','Ja'=>'true'),$_POST['active'],'active'); + $panel->content.='
    '; + $panel->field(array('name'=>'send','typ'=>'hidden','value'=>'1')); + $panel->field(array('name'=>'id','typ'=>'hidden','value'=>$_GET['id'])); + $panel->content.='
    '; + $panel->submit(); + $panel->formClose(); + }elseif($_GET['action']=='delete' && $_GET['id']){ + $db->query("DELETE FROM `" . $config['prefix'] . "news` WHERE `id`='".intval($_GET['id'])."'"); + $panel->admin_message('News gelöscht!','Die News wurden erfolgreich gelöscht.',True,'edit_news',3); + } + + }else{ + $result = $db->query("SELECT a.`title`,a.`id`,a.`active`,a.`date`,c.`name`,u.`username` FROM `" . $config['prefix'] . "news` a LEFT JOIN `" . $config['prefix'] . "news_category` c ON a.`category`=c.`id` LEFT JOIN `" . $config['prefix'] . "users` u on a.`author`=u.`uid`") or die($db->error()); + while($row=$db->fetch_array($result, MYSQL_ASSOC)){ + $row['dates']=date('d.m.Y',$row['date']); + $news[]=$row; + } + $panel->title='Vorhandene Artikel'; + $panel->content.=' + + + + + + + + '; + if(!empty($news)){ + foreach($news as $u){ + if($u['active']=='true'){ + $u['a']='Ja'; + }else{ + $u['a']='Nein'; + } + $panel->content.=' + + + + + '; + $panel->content.=' + '; + } + }else{ + $panel->content.=' + + '; + } + $panel->content.='
    IDNameKategorienAktivUserAktionen
    '.$u['id'].''.$u['title'].''.$u['name'].''.$u['a'].''.$u['username'].'
    Keine News vorhanden.

    '; + } + } + + function meta(){ + global $config; + $meta=" + "; + $meta.=' + + '; + $meta.=''; + $meta.=' + + + '; + return $meta; + } +} +?> \ No newline at end of file diff --git a/modules/ajaxpm/admin/editcategory.apnl.php b/modules/ajaxpm/admin/editcategory.apnl.php new file mode 100644 index 0000000..5f0b4a1 --- /dev/null +++ b/modules/ajaxpm/admin/editcategory.apnl.php @@ -0,0 +1,190 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: editcategory.apnl.php 96 2010-02-17 21:56:41Z genuineparts $ +*/ + +If (!defined("in_BL_ADMIN")) { + die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); +} +$session->page_begin("edit news category", True); + +class editcategory_news_panel extends admin_module{ + + function output(){ + global $config, $db,$panel, $session, $root, $core, $admin; + $fail=FALSE; + + if(isset($_POST['send'])&& $_POST['send']==1){ + if(isset($_POST['name'])&& $_POST['name']!=""){ + $userfile_name = $_FILES['picture']['name']; + $userfile_tmp = $_FILES['picture']['tmp_name']; + $userfile_size = $_FILES['picture']['size']; + $userfile_type = $_FILES['picture']['type']; + $filedir = $root.'/newsimages/'; + $size = 120; + if (isset($_FILES['picture']['name']) && $_FILES['picture']['name']!=""){ + $prod_img = $filedir.$userfile_name; + $ret=$core->upload_file($prod_img, $userfile_tmp, $size, $size, TRUE, TRUE); + if($ret!==TRUE){ + $panel->admin_message("Fehler", "Das Bild konnte nicht hochgeladen wrden
    Der Fehler war: ". $ret,TRUE,"editcategory_news"); + } + $result=$db->query("SELECT `picture` FROM `" . $config["prefix"]. "news_category` WHERE `id`='".intval($_POST["id"])."' LIMIT 1"); + $file=$db->fetch_array($result); + @unlink($filedir.$file['picture']); + $db->query("UPDATE `" . $config["prefix"]. "news_category` SET `picture`='".$userfile_name."' WHERE `id`='".intval($_POST["id"])."'"); + }elseif($_POST["delimg"]==1){ + $result=$db->query("SELECT `picture` FROM `" . $config["prefix"]. "news_category` WHERE `id`='".intval($_POST["id"])."' LIMIT 1"); + $file=$db->fetch_array($result); + @unlink($filedir.$file['picture']); + $db->query("UPDATE `" . $config["prefix"]. "news_category` SET `picture`='' WHERE `id`='".intval($_POST["id"])."'"); + } + + $name=$db->escape($_POST['name']); + $active=$db->escape($_POST['active']); + $db->query("UPDATE `" . $config["prefix"]. "news_category` SET `name`='".$name."', `active`='".$active."' WHERE `id`='".intval($_POST["id"])."'") or die($db->error()); + $panel->admin_message("Danke", "Die Kategorie wurde erfolgreich editiert!.",TRUE,"editcategory_news"); + }else{ + $fail="Der Kategoriename muss angegeben werden!"; + } + + }elseif(isset($_GET['id'])&& $_GET['id']!=""){ + if($_GET['action']=="edit"){ + $result = $db->query("SELECT * FROM `" . $config["prefix"] . "news_category` WHERE `id`='".intval($_GET['id'])."'"); + $_POST=$db->fetch_array($result); + /*$resultna=$db->query("SELECT id,name FROM " . $config["prefix"] . "menue"); + while($rowa=$db->fetch_array($resultna)){ + $resultn = $db->query("SELECT m_id FROM " . $config["prefix"] . "article_menue WHERE a_id='".intval($_GET['id'])."' and m_id='".$rowa["id"]."'"); + if($db->num_rows($resultn) >= 1){ + $rowa["checked"]="checked=\"checked\""; + } + $navs[]=$rowa; + }*/ + + + $panel->title="Kategorie editieren"; + $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=editcategory_news"),FALSE,"enctype=\"multipart/form-data\""); + if($fail){ + $panel->content.=$fail; + } + $panel->content.="

    Kategoriename:

    "; + $panel->field(array("name"=>"name","typ"=>"text","value"=>$_POST["name"])); + if($_POST["picture"]!=""){ + $panel->content.="

    aktuelles Kategoriebild:

    "; + $panel->content.="\"Kategoriebild\""; + $panel->content.="
    "; + $panel->checkbox(array("name"=>"delimg","value"=>"1")); + $panel->content.=" Bild löschen?"; + $panel->content.="
    "; + } + $panel->content.="

    neues Kategoriebild:

    "; + $panel->field(array("name"=>"picture","typ"=>"file")); + $panel->content.="
    "; + $panel->content.="

    Aktiv:

    "; + $panel->select(array("Nein"=>"false","Ja"=>"true"),$_POST["active"],"active"); + $panel->content.="
    "; + $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); + $panel->field(array("name"=>"id","typ"=>"hidden","value"=>$_GET['id'])); + $panel->content.="
    "; + $panel->submit(); + $panel->formClose(); + $panel->parse_page(); + + }elseif($_GET["action"]=="delete" && $_GET["id"]){ + $result=$db->query("SELECT `picture` FROM `" . $config["prefix"] . "news_category` where `id`='".intval($_GET["id"])."'"); + $row = $db->fetch_array($result); + @unlink($root.'/catimages/'.$row["picture"]); + $db->query("DELETE FROM `" . $config["prefix"] . "news_category` WHERE `id`='".intval($_GET["id"])."'"); + $panel->admin_message("Kategorie gelöscht!","Die Kategorie wurde erfolgreich gelöscht.",True,"editcategory_news",3); + } + + }else{ + $result = $db->query("SELECT * FROM `" . $config["prefix"] . "news_category`"); + while($row=$db->fetch_array($result, MYSQL_ASSOC)){ + $articles[]=$row; + } + $panel->title="Vorhandene Kategorien"; + $panel->content.=" + + + + + + + "; + if(!empty($articles)){ + foreach($articles as $u){ + $panel->content.=" + + + "; + if($u["active"]=="true"){ + $panel->content.=""; + }else{ + $panel->content.=""; + } + $panel->content.=" + "; + } + }else{ + $panel->content.=" + + "; + } + $panel->content.="
    IDNameBildAktivAktionen
    ".$u["id"]."".$u["name"]."".$u["picture"]."JaNein
    Keine Kategorien vorhanden.

    "; + } + } + + function meta(){ + $meta.=' + + '; + + $meta.=''; + return $meta; + } +} +?> \ No newline at end of file diff --git a/modules/ajaxpm/ajaxpm.module.php b/modules/ajaxpm/ajaxpm.module.php index 0bb0e29..ca4a563 100644 --- a/modules/ajaxpm/ajaxpm.module.php +++ b/modules/ajaxpm/ajaxpm.module.php @@ -3,7 +3,7 @@ class module_ajaxpm extends admin_module{ function admin_panels(){ - return array(); + return ""; } function get_info(){ diff --git a/modules/contact/contact.module.php b/modules/contact/contact.module.php index 9e55382..74becaa 100644 --- a/modules/contact/contact.module.php +++ b/modules/contact/contact.module.php @@ -11,7 +11,7 @@ class module_contact extends admin_module{ $info["file"]="contact"; $info["author"]="BeCast"; $info["version"]="1.0.1"; - $info["url"]="http://www.becast.at"; + $info["url"]="https://www.becast.at"; return $info; } @@ -26,7 +26,7 @@ class module_contact extends admin_module{ );"); $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_email', 'contact@example.com', 'E-Mailadresse', 'Die E-Mailadresse(n) an die Kontaktanfragen gesendet werden sollen (mehrere Adressen mit Komma trennen).', 'text', ".$cid."), ('contact_captcha', '1', 'Captcha verwenden?', 'Soll bei der Kontaktaufnahme ein Captcha angezeigt werden?', 'yesno', ".$cid.");"); return TRUE; } diff --git a/modules/contact/contact.output.php b/modules/contact/contact.output.php index 609ef07..78c35e0 100644 --- a/modules/contact/contact.output.php +++ b/modules/contact/contact.output.php @@ -1,4 +1,4 @@ - * @package astat core * @license http://opensource.org/licenses/gpl-license.php GNU Public License -* @version $Id$ +* @version $Id: 1c1aad35216bcebbefdb0b9e052dfd98790dd4f5 $ */ If (!defined("INBCWE")) { diff --git a/modules/news/admin/add.apnl.php b/modules/news/admin/add.apnl.php index a77f484..c12e823 100644 --- a/modules/news/admin/add.apnl.php +++ b/modules/news/admin/add.apnl.php @@ -22,7 +22,7 @@ * @author Bernhard Jaud * @package BcWe core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: a77f484c5af9480fe4eb2692627e2328278573ea $ */ If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); diff --git a/modules/news/admin/addcategory.apnl.php b/modules/news/admin/addcategory.apnl.php index 48c2cf7..12faac1 100644 --- a/modules/news/admin/addcategory.apnl.php +++ b/modules/news/admin/addcategory.apnl.php @@ -22,7 +22,7 @@ * @author Bernhard Jaud * @package astat core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id: addcategory.apnl.php 96 2010-02-17 21:56:41Z genuineparts $ + * @version $Id: bc487c72e70ee89c97e2348303049f9a0c268b90 $ */ If (!defined("IN_BCWE_ADMIN")) { diff --git a/modules/news/admin/edit.apnl.php b/modules/news/admin/edit.apnl.php index 8a557be..cd859f0 100644 --- a/modules/news/admin/edit.apnl.php +++ b/modules/news/admin/edit.apnl.php @@ -22,7 +22,7 @@ * @author Bernhard Jaud * @package BeCast WebEngine core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id: edit.apnl.php 96 2010-02-17 21:56:41Z genuineparts $ + * @version $Id: e570239bc108247b89c17cf3fd52cf8826a900d8 $ */ If (!defined('IN_BCWE_ADMIN')) { die('Dieses Script kann nicht ausserhalb des Frameworks laufen!'); @@ -95,14 +95,14 @@ class edit_news_panel extends admin_module{ $news[]=$row; } $panel->title='Vorhandene Artikel'; - $panel->content.=' + $panel->content.='
    - - - - - - + + + + + + '; if(!empty($news)){ foreach($news as $u){ @@ -112,17 +112,17 @@ class edit_news_panel extends admin_module{ $u['a']='Nein'; } $panel->content.=' - - - - - '; - $panel->content.=' + + + + + '; + $panel->content.=''; } }else{ $panel->content.=' - + '; } $panel->content.='
    IDNameKategorienAktivUserAktionenIDNameKategorienAktivUserAktionen
    '.$u['id'].''.$u['title'].''.$u['name'].''.$u['a'].''.$u['username'].' '.$u['id'].''.$u['title'].''.$u['name'].''.$u['a'].''.$u['username'].'
    Keine News vorhanden.Keine News vorhanden.

    '; diff --git a/modules/news/admin/editcategory.apnl.php b/modules/news/admin/editcategory.apnl.php index 7da7e3b..89bac96 100644 --- a/modules/news/admin/editcategory.apnl.php +++ b/modules/news/admin/editcategory.apnl.php @@ -1,4 +1,4 @@ - * @package BeCast WebEngine core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id: editcategory.apnl.php 96 2010-02-17 21:56:41Z genuineparts $ + * @version $Id: ef38cf94caf9812acfbf9f594045a1ca24c42eae $ */ If (!defined("IN_BCWE_ADMIN")) { @@ -125,31 +125,31 @@ class editcategory_news_panel extends admin_module{ $articles[]=$row; } $panel->title="Vorhandene Kategorien"; - $panel->content.=" + $panel->content.="
    - - - - - + + + + + "; if(!empty($articles)){ foreach($articles as $u){ $panel->content.=" - - - "; + + + "; if($u["active"]=="true"){ - $panel->content.=""; + $panel->content.=""; }else{ - $panel->content.=""; + $panel->content.=""; } - $panel->content.=" + $panel->content.=""; } }else{ $panel->content.=" - + "; } $panel->content.="
    IDNameBildAktivAktionenIDNameBildAktivAktionen
    ".$u["id"]."".$u["name"]."".$u["picture"]."".$u["id"]."".$u["name"]."".$u["picture"]."JaJaNeinNein
    Keine Kategorien vorhanden.Keine Kategorien vorhanden.

    "; diff --git a/modules/text/admin/add.apnl.php b/modules/text/admin/add.apnl.php index b9eeb0f..929bd47 100644 --- a/modules/text/admin/add.apnl.php +++ b/modules/text/admin/add.apnl.php @@ -22,7 +22,7 @@ * @author Bernhard Jaud * @package astat core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: b9eeb0fd7ab78feed4582e33dd2604a26281a58f $ */ If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); diff --git a/modules/text/admin/addcategory.apnl.php b/modules/text/admin/addcategory.apnl.php index ca7c3b9..29e79cf 100644 --- a/modules/text/admin/addcategory.apnl.php +++ b/modules/text/admin/addcategory.apnl.php @@ -22,7 +22,7 @@ * @author Bernhard Jaud * @package astat core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: ca7c3b985bdb214ce7622dc7397419774c03bace $ */ If (!defined("IN_BCWE_ADMIN")) { diff --git a/modules/text/admin/edit.apnl.php b/modules/text/admin/edit.apnl.php index f08e37a..3c5e9df 100644 --- a/modules/text/admin/edit.apnl.php +++ b/modules/text/admin/edit.apnl.php @@ -22,7 +22,7 @@ * @author Bernhard Jaud * @package astat core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: 3ab99ecb3291e81fff1273ceb58bd035ae66feb6 $ */ If (!defined("IN_BCWE_ADMIN")) { die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); @@ -85,7 +85,7 @@ class edit_text_panel extends admin_module{ $panel->select($karray,$_POST["menue"],"menue"); $panel->content.="
    "; $panel->content.="

    Kategorien:

    - +
    "; $resultn = $db->query("SELECT `c_id` FROM `" . $config["prefix"] . "article_category` WHERE `a_id`='".intval($_GET['id'])."'"); while($rowa=$db->fetch_array($resultn)){ @@ -125,15 +125,15 @@ class edit_text_panel extends admin_module{ $panel->formClose(); }elseif($_GET["action"]=="delete" && $_GET["id"]){ $db->query("DELETE FROM `" . $config["prefix"] . "article` WHERE `id`='".intval($_GET["id"])."'"); - $db->query("DELETE FROM `" . $config["prefix"] . "article_menue` where `a_id`='".$id."'"); + $db->query("DELETE FROM `" . $config["prefix"] . "article_menue` where `a_id`='".intval($_GET["id"])."'"); $panel->admin_message("Artikel gelöscht!","Der Artikel wurde erfolgreich gelöscht.",True,"edit_text",3); } }else{ $result = $db->query("SELECT a.title,a.id,a.active,a.date,a.url,u.username FROM `" . $config["prefix"] . "article` a LEFT JOIN `" . $config["prefix"] . "users` u on a.`author`=u.`uid`"); - while($row=$db->fetch_array($result, $db->ASSOC)){ + while($row=$db->fetch_array($result)){ $cresult=$db->query("SELECT a.`categoryname` FROM `" . $config["prefix"] . "article_categories` a LEFT JOIN `" . $config["prefix"] . "article_category` c on a.`id`=c.`c_id` WHERE c.`a_id`='".$row["id"]."'"); - while($crow=$db->fetch_array($cresult, $db->ASSOC)){ + while($crow=$db->fetch_array($cresult)){ if(!$row["categoryname"]){ $row["categoryname"]=$crow["categoryname"]; }else{ @@ -144,15 +144,15 @@ class edit_text_panel extends admin_module{ $articles[]=$row; } $panel->title="Vorhandene Artikel"; - $panel->content.="
    + $panel->content.="
    - - - - - - - + + + + + + + "; if(!empty($articles)){ foreach($articles as $u){ @@ -162,18 +162,18 @@ class edit_text_panel extends admin_module{ $u["a"]="Nein"; } $panel->content.=" - - - - - - "; - $panel->content.=" + + + + + + "; + $panel->content.=""; } }else{ $panel->content.=" - + "; } $panel->content.="
    IDNameURLKategorienAktivUserAktionenIDNameURLKategorienAktivUserAktionen
    ".$u["id"]."".$u["title"]."".$u["url"]."".$u["categoryname"]."".$u["a"]."".$u["username"]." ".$u["id"]."".$u["title"]."".$u["url"]."".$u["categoryname"]."".$u["a"]."".$u["username"]."
    Keine Artikel vorhanden.Keine Artikel vorhanden.

    "; diff --git a/modules/text/admin/editcategory.apnl.php b/modules/text/admin/editcategory.apnl.php index 08fb4f4..283335c 100644 --- a/modules/text/admin/editcategory.apnl.php +++ b/modules/text/admin/editcategory.apnl.php @@ -22,7 +22,7 @@ * @author Bernhard Jaud * @package BeCast WebEngine core * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ + * @version $Id: 0a547989ebfde4dba7c560bb10b1e925117c26a9 $ */ If (!defined("IN_BCWE_ADMIN")) { @@ -125,31 +125,31 @@ class editcategory_text_panel extends admin_module{ $articles[]=$row; } $panel->title="Vorhandene Kategorien"; - $panel->content.=" + $panel->content.="
    - - - - - + + + + + "; if(!empty($articles)){ foreach($articles as $u){ $panel->content.=" - - - "; + + + "; if($u["active"]=="true"){ - $panel->content.=""; + $panel->content.=""; }else{ - $panel->content.=""; + $panel->content.=""; } - $panel->content.=" + $panel->content.=""; } }else{ $panel->content.=" - + "; } $panel->content.="
    IDNameBildAktivAktionenIDNameBildAktivAktionen
    ".$u["id"]."".$u["categoryname"]."".$u["picture"]."".$u["id"]."".$u["categoryname"]."".$u["picture"]."JaJaNeinNein
    Keine Kategorien vorhanden.Keine Kategorien vorhanden.

    "; @@ -157,7 +157,8 @@ class editcategory_text_panel extends admin_module{ } function meta(){ - $meta.=' + global $config; + $meta ='