Ankündigung

Einklappen
Keine Ankündigung bisher.

chmod???

Einklappen

Neue Werbung 2019

Einklappen
X
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • chmod???

    Moin,

    ich habe mir ein forenhosting script gekauft. Die installation hat super geklappt. wenn sich ein user anmeldet sollte ein ordner erstellt werden, und die forendateien in diesen ordner kopiert werden. Jetzt zu meinem problem:
    das script legt den ordner mit chmod 755 an, kopiert aber keine dateien rein.
    kann ich im script eine änderung vornehmen das der ordner gleich mit chmod 777 erstellt wird?


    hier die datei die den neuen ordner anlegt:

    Code:
    <?
    function anmelden() {
        include("header.php");
        	echo $_text52;
        if ($subdomainservice == "1"){
        	echo $_text53;
        }
        ?>
        <form method="POST" action="<? echo $PHP_SELF ?>">
        	<table border="0" cellpadding="0" cellspacing="0" width="100%">
        		<tr>
        			<td width="10%"></td>
        			<td width="80%">
        				<table border="0" cellpadding="0" cellspacing="0" width="100%">
                            <tr>
                            	<td width="55%"><? echo $_text27 ?>:</td>
                            	<td width="45%"><input type="text" name="name" size="20"></td>
                            </tr>
                            <tr>
                            	<td width="55%"></td>
                            	<td width="45%"></td>
                            </tr>
                            <tr>
                            	<td width="55%"><? echo $_text28 ?>:</td>
                            	<td width="45%"><input type="text" name="vorname" size="20"></td>
                            </tr>
                            <tr>
                            	<td width="55%"></td>
                            	<td width="45%"></td>
                            </tr>
                            <tr>
                            	<td width="55%"><? echo $_text29 ?>:</td>
                            	<td width="45%"><input type="text" name="straße" size="20"></td>
                            </tr>
                            <tr>
                            	<td width="55%"></td>
                            	<td width="45%"></td>
                            </tr>
        					<tr>
                            	<td width="55%"><? echo $_text30 ?>:</td>
                            	<td width="45%"><input type="text" name="plz" maxlength="5" size="5"></td>
                            </tr>
                            <tr>
                            	<td width="55%"></td>
                            	<td width="45%"></td>
                            </tr>
                            <tr>
                            	<td width="55%"><? echo $_text31 ?>:</td>
                            	<td width="45%"><input type="text" name="ort" size="20"></td>
                            </tr>
                            <tr>
                            	<td width="55%"></td>
                            	<td width="45%"></td>
                            </tr>
        					<tr>
        						<td width="55%"><? echo $_text32 ?>:</td>
        						<td width="45%"><select size='1' name='land'><option selected value="<? echo $_text54 ?>"><? echo $_text54 ?></option><option value="<? echo $_text55 ?>"><? echo $_text55 ?></option><option value="<? echo $_text56 ?>"><? echo $_text56 ?></option><option value="<? echo $_text57 ?>"><? echo $_text57 ?></option></select></td>
        					</tr>
                            <tr>
                            	<td width="55%"></td>
                            	<td width="45%"></td>
                            </tr>
                            <tr>
        						<td width="55%"><? echo $_text33 ?>:</td>
        						<td width="45%"><input type="text" name="tag" maxlength="2" size="1">.<input type="text" name="monat" maxlength="2" size="1">.<input type="text" name="jahr" maxlength="4" size="3"></td>
        					</tr>
                            <tr>
                            	<td width="55%"></td>
                            	<td width="45%"></td>
                            </tr>
                            <tr>
                            	<td width="55%"></td>
                            	<td width="45%"></td>
                            </tr>
                            <tr>
                            	<td width="55%"></td>
                            	<td width="45%"></td>
                            </tr>
                            <tr>
                            	<td width="55%"><? echo $_text26 ?>:</td>
                            	<? if ($_GET['benutzername'] != "") $locked = "disabled='disabled'"; ?>
                            	<td width="45%"><input type="text" value="<? echo $_GET['benutzername'] ?>" <? echo $locked ?> name="benutzername" size="20"></td>
                            </tr>
                            <tr>
                            	<td width="55%"></td>
                            	<td width="45%"></td>
                            </tr>
                            <tr>
                            	<td width="55%"><? echo $_text36 ?>:</td>
                            	<td width="45%"><select size="1" name="kategorie">
                                    <?
                                    $query_string="SELECT * FROM ".$prefix."Kategorien ORDER BY name ASC";
                                    $result=mysql_query($query_string, $dbb);
                                    while ($datensatz = mysql_fetch_object($result)){
                                        echo "<option value='".$datensatz->id."'>".$datensatz->name."</option>";
                                    }
                                    ?>
                                    </select>
    						</td>
                            </tr>
                            <tr>
                            	<td width="55%"></td>
                            	<td width="45%"></td>
                            </tr>
                            <tr>
                            	<td width="55%"><? echo $_text35 ?>:</td>
                            	<td width="45%"><input type="text" name="email" size="20"></td>
                            </tr>
                            <tr>
                            	<td width="55%"></td>
                            	<td width="45%"></td>
                            </tr>
                            <tr>
                            	<td width="55%"><? echo $_text222 ?>:</td>
                            	<td width="45%"><input type="text" name="url" size="20"></td>
                            </tr>
                            <tr>
                            	<td width="55%"></td>
                            	<td width="45%"></td>
                            </tr>
                            <tr>
                            	<td width="55%"><? echo $_text58 ?>:</td>
                            	<td width="45%"><input type="checkbox" name="agbs" value="1"><? echo $_text59 ?></td>
                            </tr>
                            <tr>
                            	<td width="55%"></td>
                            	<td width="45%"></td>
                            </tr>
                            <tr>
                            	<td width="55%"></td>
                            	<td width="45%"></td>
                            </tr>
                            <tr>
                            	<td width="55%"><? echo $_text281 ?>:</td>
                            	<td width="45%"><?
                                    $query_string="SELECT * FROM ".$prefix."Masterforen ORDER BY id ASC";
                                    $result=mysql_query($query_string, $dbb);
                                    $selected = "checked";
                                    while ($datensatz = mysql_fetch_object($result)){
                                        echo "<input $selected type='radio' name='masterforum' value='$datensatz->id'> $datensatz->name (id)'>".$_text282.")
    ";
                                    	$selected = "";
                                    }
                                    ?>
    
    
    
                            	</td>
                            </tr>
                            <tr>
                            	<td width="55%"></td>
                            	<td width="45%"></td>
                            </tr>
                            <? if ($ANMELDUNG_CODE == "1"){ ?>
                            <tr>
                            	<td width="55%"></td>
                            	<td width="45%"></td>
                            </tr>
                            <tr>
                            	<td colspan="2">
    <center>[img]images/bild.php[/img]
    
    </center></td>
                            </tr>
                            <tr>
                            	<td width="55%"><? echo $_text259 ?>:</td>
                            	<td width="45%"><input type="text" name="code" size="20"></td>
                            </tr>
                            <? } ?>
                            <tr>
                            	<td width="55%"></td>
                            	<td width="45%"><input type="hidden" name="op" value="anmelden2"></td>
                            </tr>
                            <tr>
                            	<td width="100%" colspan="2"><center><input value="<? echo $_text60 ?>" type="submit"></center></td>
                            </tr>
                        </table>
                    </td>
                <td width="10%"></td>
            </tr>
        </table>
        </form>
    	<?
    	include("footer.php");
    }
    
    function anmelden2($name, $benutzername, $email, $vorname, $straße, $plz, $ort, $land, $agbs, $tag, $monat, $jahr, $kategorie, $url, $code, $masterforum) {
        include("set-conf-einst.php");
        @session_start();
        $benutzername = strtolower($benutzername);
        $requete = "SELECT * FROM ".$prefix."User Where username='$benutzername'";
        $result = mysql_query ($requete,$dbb);
        $us =mysql_fetch_object($result);
        $requete = "SELECT * FROM ".$prefix."User Where email='$email'";
        $result = mysql_query ($requete,$dbb);
        $emailer =mysql_fetch_object($result);
        $ip =  $GLOBALS[REMOTE_ADDR];
        $requete = "SELECT * FROM ".$prefix."User Where ip='$ip'";
        $result = mysql_query ($requete,$dbb);
        $iper =mysql_fetch_object($result);
        include("header.php");
        $abfrage = "SELECT * FROM ".$prefix."Datenbanken Where anzahl<maximal Order by id ASC";
    	$ergebnis = mysql_query($abfrage);
    	$datenb = mysql_fetch_object($ergebnis);
    	$sub = explode(".", $SERVER_NAME);
    	if ($name == ""){
    		echo $_text61;
    	}elseif ($_SESSION['gencode'] == "" and $ANMELDUNG_CODE == "1"){
    		echo $_text260;
    	}elseif ($datenb->anzahl == ""){
    		echo $_text269;
    	}elseif ($code == "" and $ANMELDUNG_CODE == "1"){
    		echo $_text261;
    	}elseif ($_SESSION['gencode'] != $code and $ANMELDUNG_CODE == "1"){
    		echo $_text262;
    	}elseif ($benutzername == ""){
    		echo $_text62;
    	}elseif ($benutzername == "www" or $benutzername == $sub[0]){
    		echo $_text280;
    	}elseif (!is_numeric($tag) or !is_numeric($monat) or !is_numeric($jahr) or $tag == "" or $monat == "" or $jahr =="" or $tag >"31" or $monat >"12"){
    		echo $_text63;
    	}elseif ($vorname == ""){
    		echo $_text64;
    	}elseif ($tag == "0" or $tag > "31" or $monat == "0" or $monat > "12" or $jahr < "1900" or $jahr > date("Y")){
    		echo $_text258;
    	}elseif ($straße == ""){
    		echo $_text65;
    	}elseif ($plz == ""){
    		echo $_text66;
    	}elseif ($ort == ""){
    		echo $_text67;
    	}elseif (!is_numeric($plz)){
    		echo $_text68;
    	}elseif ($us->username != ""){
    		echo $_text69;
    	}elseif ($emailer->email != ""){
    		echo $_text70;
    	}elseif (substr_count($benutzername, " ") != "0"){
    		echo $_text257;
    	}elseif ($iper->email != ""){
    		echo $_text223;
    	}elseif ($email == ""){
    		echo $_text71;
    	}elseif ($agbs != "1"){
    		echo $_text72;
    	}elseif ($email != "" && !eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,4}$",$email)) {
    		echo $_text73;
    	}else {
    		if($url != ""){
    			if($url[0] != "h") $url = "http://".$url;
    		}
            $passwort = md5(time());
        	$passwort = substr($passwort, 0, 6);
        	$geburtstag = $tag.".".$monat.".".$jahr;
        	$time = time();
        	$abfrage = "SELECT * FROM ".$prefix."Datenbanken Where anzahl<maximal Order by id ASC";
    		$ergebnis = mysql_query($abfrage);
    		$datenb = mysql_fetch_object($ergebnis);
    		$abfrage = "SELECT * FROM ".$prefix."Masterforen Where id='$masterforum'";
    		$ergebnis = mysql_query($abfrage);
    		$datforum = mysql_fetch_object($ergebnis);
    		if($datforum->tage == "0"){
    			$wb_frei_status = "0";
    			$wb_frei_ende = "0";
    		}elseif($datforum->tage == ""){
    			$wb_frei_status = "0";
    			$wb_frei_ende = "0";
    		}else{
    			$datforum->werbung = "0";
    			$wb_frei_status = "1";
    			$now = time();
    			$mal = 60 * 60 * 24;
    			$plus = $datforum->tage * $mal;
    			$wb_frei_ende = $now + $plus;
    		}
    		$aktuell = $datenb->anzahl + 1;
            $query_string="UPDATE ".$prefix."Datenbanken SET anzahl='$aktuell' WHERE id='$datenb->id'";
            $result=mysql_query($query_string, $dbb);
    		$result = mysql_query("insert into ".$prefix."User values ('',
    																   '$benutzername',
    																   '$name',
    																   '$vorname',
    																   '$email',
    																   '$url',
    																   '$kategorie',
    																   '$passwort',
    																   '$straße',
    																   '$plz',
    																   '$ort',
    																   '$land',
    																   '$geburtstag',
    																   '$ip',
    																   '$time',
    																   '$datenb->id',
    																   '',
    																   '',
    																   '$datforum->werbung',
    																   '$masterforum',
    																   '$wb_frei_status',
    																   '$wb_frei_ende',
    																   '$datforum->post_limit',
    																   '$datforum->user_limit')", $dbb);
    		$userid = mysql_insert_id();
    		$from  = "From: ".$EMAIL."\n";
            $from .= "Reply-To: ".$EMAIL."\n";
            $from .= "X-Sender-IP: $REMOTE_ADDR\n";
            $from .= "Content-Type: text/html";
            $text = $mail_anmelden;
            $text = str_replace ("_USERID_", $userid, $text);
            $text = str_replace ("_VORNAME_", $vorname, $text);
            $text = str_replace ("_NAME_", $name, $text);
            $text = str_replace ("_URL_", $url, $text);
            $abfrage = "SELECT * FROM ".$prefix."Kategorien Where id='$kategorie'";
    		$ergebnis = mysql_query($abfrage);
    		$datkat = mysql_fetch_object($ergebnis);
            $text = str_replace ("_KATEGORIE_", $datkat->name, $text);
            $text = str_replace ("_BENUTZERNAME_", $benutzername, $text);
            $text = str_replace ("_PASSWORT_", $passwort, $text);
            mail($email, $mail_anmelden_betreff, $text, $from);
            mail($ADMIN_MAIL, $mail_anmelden_betreff, $text, $from);
            $source = $PFAD."masterforen/masterforum_".$masterforum."/files/";
            $dest = $PFAD."phpbb".$userid."/";
            copyr($source, $dest);
            $pfad = $PFAD."masterforen/masterforum_".$masterforum."/schemas/mysql_schema.sql";
            $userdatei = fopen($pfad,"r");
            while(!feof($userdatei))
               {
               $mysql_schema .= fgets($userdatei,1024);
               }
            fclose($userdatei);
            $prefixneu = $datenb->prefix."phpbb_".$userid."_";
            $dbbfh = mysql_connect($datenb->host,$datenb->user,$datenb->pass);
    		mysql_select_db($datenb->datenbank,$dbbfh);
    		$mysql_schema = str_replace ("phpbb_", $prefixneu, $mysql_schema);
    		$zeile = explode("\n", $mysql_schema);
    		$linecount = sizeof($zeile);
    	    for ($i = 0; $i < $linecount; $i++){
                if ($zeile[$i][0] != "#") {
                    $mysql_schema .= $zeile[$i] . "\n";
                }else{
                    $mysql_schema .= "\n";
                }
            }
    		$mysql_schema_a = explode(");", $mysql_schema);
    		for ($i = 0; $i < sizeof($mysql_schema_a); $i++){
    			$mysql_schema_a[$i] = $mysql_schema_a[$i].");";
    			$result = mysql_query($mysql_schema_a[$i], $dbbfh);
    		}
    		$pfad = $PFAD."masterforen/masterforum_".$masterforum."/schemas/mysql_basic.sql";
            $userdatei = fopen($pfad,"r");
            while(!feof($userdatei))
               {
               $mysql_basic .= fgets($userdatei,1024);
               }
            fclose($userdatei);
    		$mysql_basic = str_replace ("phpbb_", $prefixneu, $mysql_basic);
    		$zeile = explode("\n", $mysql_basic);
    		$linecount = count($sizeof);
    	    for ($i = 0; $i < $linecount; $i++){
                if ($zeile[$i][0] != "#") {
                    $mysql_basic .= $zeile[$i] . "\n";
                }else{
                    $mysql_basic .= "\n";
                }
            }
    		$mysql_basic_a = explode(");", $mysql_basic);
    		for ($i = 0; $i < sizeof($mysql_basic_a); $i++){
    			$mysql_basic_a[$i] = $mysql_basic_a[$i].");";
    			$result = mysql_query($mysql_basic_a[$i], $dbbfh);
    		}
    		$pfad = $PFAD."masterforen/masterforum_".$masterforum."/schemas/mysql_extra.sql";
            $userdatei = fopen($pfad,"r");
            while(!feof($userdatei))
               {
               $mysql_extra .= fgets($userdatei,1024);
               }
            fclose($userdatei);
    		$mysql_extra = str_replace ("phpbb_", $prefixneu, $mysql_extra);
    		$zeile = explode("\n", $mysql_extra);
    		$linecount = sizeof($zeile);
    	    for ($i = 0; $i < $linecount; $i++){
                if ($zeile[$i][0] != "#") {
                    $mysql_extras .= $zeile[$i] . "\n";
                }else{
                    $mysql_extras .= "\n";
                }
            }
    		$mysql_extra_a = explode(");", $mysql_extras);
    		for ($i = 0; $i < sizeof($mysql_extra_a); $i++){
    			$mysql_extra_a[$i] = $mysql_extra_a[$i].");";
    			$result = mysql_query($mysql_extra_a[$i], $dbbfh);
    		};
    		$sql = "INSERT INTO " . $prefixneu . "config (config_name, config_value)	VALUES ('board_startdate', " . time() . ")";
    		$result = mysql_query($sql, $dbbfh);
    		$sql = "INSERT INTO " . $prefixneu . "config (config_name, config_value)	VALUES ('board_startdate', " . time() . ")";
    		$result = mysql_query($sql, $dbbfh);
    
    		$query_string= "SELECT * FROM " . $prefixneu . "users ORDER by user_id DESC";
            $result=mysql_query($query_string, $dbbfh);
            $phpb = mysql_fetch_object($result);
            $idd = $phpb->user_id + 1;
            $query_string= "SELECT * FROM " . $prefixneu . "user_group ORDER by group_id DESC";
            $result=mysql_query($query_string, $dbbfh);
            $phpbb = mysql_fetch_object($result);
            $idg = $phpbb->group_id + 1;
            $pad = md5($configuration->foren_passwort);
            $tim = time();
            $result = mysql_query("insert into " . $prefixneu . "users values (
                 '$idd',
                 '1',
                 '$configuration->foren_user',
                 '$pad',
                 '',
                 '',
                 '',
                 '$tim',
                 '0',
                 '0',
                 '0.00',
                 '1',
                 'german',
                 'D M d, Y g:i a',
                 '0',
                 '0',
                 '0',
                 '',
                 '0',
                 '0',
                 '0',
                 '1',
                 '1',
                 '1',
                 '1',
                 '1',
                 '0',
                 '1',
                 '1',
                 '0',
                 '',
                 '0',
                 '$configuration->foren_email',
                 '',
                 '',
                 '',
                 '',
                 '',
                 '',
                 '',
                 '',
                 '',
                 '',
                 '',
                 '')", $dbbfh);
            $result = mysql_query("insert into " . $prefixneu . "user_group values (
                 '$idg',
                 '$idd',
                 '0')", $dbbfh);
    		$sql = "INSERT INTO " . $prefixneu . "config (config_name, config_value)	VALUES ('default_lang', 'german')";
    		$result = mysql_query($sql, $dbbfh);
    		$passwort = md5($passwort);
    		$sql = "UPDATE " . $prefixneu . "users	SET username = '$benutzername', user_password='$passwort', user_lang = 'german', user_email='$email' WHERE username = 'Admin'";
    		$result = mysql_query($sql, $dbbfh);
    		$sql = "UPDATE " . $prefixneu . "users   SET user_regdate = " . time()."";
    		$result = mysql_query($sql, $dbbfh);
    		$sql = "UPDATE " . $prefixneu . "config   SET config_value = '$email' WHERE config_name='board_email'";
    		$result = mysql_query($sql, $dbbfh);
    		$dest = $UNTERORDNER."phpbb".$userid."/";
    		$sql = "UPDATE " . $prefixneu . "config   SET config_value = '$dest' WHERE config_name='script_path'";
    		$result = mysql_query($sql, $dbbfh);
    		$sql = "UPDATE " . $prefixneu . "config   SET config_value = '80' WHERE config_name='server_port'";
    		$result = mysql_query($sql, $dbbfh);
    		$sql = "UPDATE " . $prefixneu . "config   SET config_value = '$SERVER_NAME' WHERE config_name='server_name'";
    		$result = mysql_query($sql, $dbbfh);
    		$config_data = '<?php'."\n\n";
            $config_data .= "\n// Config-Datei!\n\n";
            $config_data .= '$dbms = \'mysql\';' . "\n\n";
            $config_data .= '$dbhost = \'' . $datenb->host . '\';' . "\n";
            $config_data .= '$dbname = \'' . $datenb->datenbank . '\';' . "\n";
            $config_data .= '$dbuser = \'' . $datenb->user . '\';' . "\n";
            $config_data .= '$dbpasswd = \'' . $datenb->pass . '\';' . "\n\n";
            $config_data .= '$table_prefix = \'' . $prefixneu . '\';' . "\n\n";
            $config_data .= 'define(\'PHPBB_INSTALLED\', true);'."\n\n";
            $config_data .= '?' . '>';
            $conf = $PFAD."phpbb".$userid."/config.php";
            chmod($conf, 0777);
            $datei = fopen($conf,"r+");
            rewind($datei);
            fwrite($datei, $config_data);
            fclose($datei);
            chmod($conf, 0644);
            $datei = $PFAD."phpbb".$userid."/images/avatars/";
            chmod($datei, 0777);
            echo $_text224;
    	}
    	include("footer.php");
    }
    
    ?>
    thx schonmal für die hilfe

    [/code]


  • #2
    also bei gekauften scripten ist das oft relativ schwierig. ich habe auch nichts finden können in deiner datei. also vermute ich das du das noch einbauen müsstest.
    wie weiss ich leider nicht, aber ich hoffe das nimmt mir keiner übel. :wink:

    PS: könntest du das nächste mal vielleicht die php zeichen und nicht die code zeichen benutzen? danke!

    EDIT:
    PHP-Code:
    <?php
     chmod
    ($conf0644);
    ?>
    probier stattdessen mal das:
    PHP-Code:
    <?php
     chmod
    ($conf0777);
    ?>
    ist in der 9.Zeile von unten

    Kommentar


    • #3
      weiss denn keiner rat????

      Kommentar


      • #4
        Wo ist denn überhaupt der Quellcode, mit dem die Verzeichnisse erstellt werden?

        Kommentar

        Lädt...
        X