Commit 0f668012 authored by Eric Laufer's avatar Eric Laufer

Update MySQL Addon install

Fehler bei der nutzung behoben
parent e38081ff
......@@ -17,14 +17,14 @@ class mysql{
private function make_array($post,$file){
foreach($post AS $key => $value){
if($key != '' && $key != 'run' && $value != ''){
$this->post[$key] = $this->db->escape($value);
$this->post[$key] = $value;
}
}
}
public function ausfuehren($post,$file){
$this->make_array($post,$file);
if($this->session['admin'] != 1){ die("Nicht genemigter Zugriff");
if($this->session['admin'] != 1){ die("Nicht genemigter Zugriff");}
$this->CheckUpload($file);
if($this->error == 0){
......@@ -37,6 +37,7 @@ class mysql{
private function CheckUpload($file){
if(isset($this->post['mysqltxt']) || !empty($this->post['mysqltxt']) ){
$this->post['mysqltxt'] = str_replace(array("\r\n","\n\r", "\n", "\r"),"",$this->post['mysqltxt']);
$this->txt();
}elseif(isset($file)){
$this->file($file);
......@@ -51,14 +52,14 @@ class mysql{
$endung = strtolower(pathinfo($file['mysqldatei']['name'], PATHINFO_EXTENSION));
if(!in_array($endung,array("sql","txt"))){ $this->error = 1; $this->meldung = MYSQL_DATEITYPE_FALSE;}
if($this->error == 0){
$this->MySQLTXT = str_replace("vms_",PREFIX , file_get_contents($file['mysqldatei']['tmp_name'],true));
$this->mysqlTXT = str_replace("vms_",PREFIX , file_get_contents($file['mysqldatei']['tmp_name'],true));
}
}
private function import(){
$explode = explode(";",$this->MySQLTXT);
$explode = explode(";",$this->mysqlTXT);
for($i = 0; $i <= count($explode)-1; $i++){
$this->db->query($explode[$]);
$this->db->query($explode[$i]);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment