Subversion-Projekte lars-tiefland.content-management

Revision

Blame | Letzte Änderung | Log anzeigen | RSS feed

<?php
    //include "Online-Shop/connect2.php";
    require_once  "connect2.php";
    require_once  "webs.php";
?>
<html>
<head>
<title>Content-Management-System - Webagentur Niewerth</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel=stylesheet type="text/css" href="buttons.css">
<style type="text/css"><MM:BeginLock translatorClass="MM_SSI" type="ssi" orig="%3C? require_once %22buttons.css%22; ?%3E" fileRef="buttons.css" depFiles="file:///L|/content-management/buttons.css">span {text-decoration:underline; color:#000000}
p {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #000000}
p.error {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold}
span {font-family: Arial, Helvetica, sans-serif; font-size: 10pt}
span.blue {font-family: Arial, Helvetica, sans-serif; color: #FFFFFF; background-color:#0000A0; font-size: 10pt}
span.small {font-family: Arial, Helvetica, sans-serif; font-size: 8pt; text-decoration: none}
td {font-family: Arial, Helvetica, sans-serif; font-size: 10pt}
td.timeout {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #FF0000;}
td.small {font-family: Arial, Helvetica, sans-serif; font-size: 8pt}
td.headline {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: #FFFFFF; font-weight: bold}
td.haupt {font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold}
input {font-family: Arial, Helvetica, sans-serif; font-size: 8pt}
select {font-family: Arial, Helvetica, sans-serif; font-size: 8pt}
textarea {font-family: Arial, Helvetica, sans-serif; font-size: 8pt}a {  text-decoration: none}
<MM:EndLock></style>
</head>
<body bgcolor="#FFFFFF" leftmargin="20" topmargin="10" marginwidth="20" marginheight="10">
<?php
    require_once  'File.php';

    // Hole bisherige Emails und EmailCode
    include "/usr/share/php/module/Email_Safe/emailconfig.default.inc.php";
    foreach ( $GLOBALS['email_config'] as $key => $value )
    {
        if ( !@in_array($value, $_POST['check']) )
        {
            $code[] = $key;
            $email[] = $value;
        }
    }

    if ( isset($_POST['neue_email']) )
    {
        $code[] = md5( $_POST['neue_email'] );
        $email[] = $_POST['neue_email'];
    }

    $text = "<?php \n";
    for ( $i = 0; $i < sizeof($code); $i++ )
    {
        $text .= '$GLOBALS["email_config"]["' . $code[$i] . '"] = "' . $email[$i] .
            '";' . "\n";
    }
    $text .= "?>";

    $file = '/usr/share/php/module/Email_Safe/emailconfig.default.inc.php';
    $e = File::write( $file, $text, FILE_MODE_WRITE );
    if ( PEAR::isError($e) )
    {
        echo 'Could not write to file : ' . $e->getMessage();
    }
    else
    {
        $cmd = "sudo svn status $file";
        exec( $cmd, $out, $ret );
        $status = substr( $out[0], 0, 1 );
        unset( $out );
        if ( $status == "?" )
        {
            $cmd = "sudo svn add $file";
            exec( $cmd, $out, $ret );
            $add = true;
        } elseif ( $status == "A" )
        {
            $add = true;
        }
        unset( $out );
        $status = ( $add ) ? "hinzugefuegt" : "geaendert";
        unset( $out );
        $msg = "\"Sachbearbeiter: " . $_SERVER["PHP_AUTH_USER"] . "\n";
        $msg .= "Konfiguration $file $status\"";
        $cmd = "sudo svn ci $file -m $msg --username www-data --password NcC2010";
        exec( $cmd, $out, $ret );
        unset( $out );
        $cmd = "sudo svn up /usr/share/php/module/Email_Safe/";
        exec( $cmd, $out, $ret );
        unset( $out );
    }


?>
        <form method="post" action="#" name="formname1" enctype="multipart/form-data">
                <table width="662" border="0" cellspacing="0" cellpadding="3" bordercolorlight="#FFFFFF" bordercolordark="#999999">
                        <tr bgcolor="#000099">
                                <td colspan="4" bgcolor="#<? echo $webs[bgcolor_links] ?>"><font color="#<? echo
    $webs[font_color_links] ?>"><strong>Mail Schutz: Bearbeiten</strong></font></td>
                        </tr>
                        <tr>
                                <td width="300" bgcolor="#<? echo $webs[bgcolor_links] ?>"><font color="#<? echo
        $webs[font_color_links] ?>">Neue Email-Adresse hinzuf&uuml;gen</font></td>
                                <td bgcolor="#<? echo $webs[bgcolor_rechts] ?>"><input type="text" size="40" name="neue_email" /></td>
                                <td bgcolor="#<? echo $webs[bgcolor_rechts] ?>"><input type="submit" name="neuer_eintrag" value="Email hinzuf&uuml;gen" /></td>
                                <td bgcolor="#<? echo $webs[bgcolor_rechts] ?>"></td>
                        </tr>
                        <tr>
                                <td bgcolor="#<? echo $webs[bgcolor_links] ?>"></td>
                                <td bgcolor="#<? echo $webs[bgcolor_rechts] ?>"><font color="#<? echo $webs[font_color_rechts] ?>">EMail</font></td>
                                <td bgcolor="#<? echo $webs[bgcolor_rechts] ?>"><font color="#<? echo $webs[font_color_rechts] ?>">Code</font></td>
                                <td bgcolor="#<? echo $webs[bgcolor_rechts] ?>"></td>
        </form>
        <form method="post" action="#" name="formname2" enctype="multipart/form-data">
<?php
    for ( $i = 0; $i < sizeof($code); $i++ )
    {
?>
                        <tr>
                                        <td bgcolor="#<? echo $webs[bgcolor_links] ?>">&nbsp;</td>
                                        <td bgcolor="#<? echo $webs[bgcolor_rechts] ?>"><?= $email[$i] ?></td>
                                        <td bgcolor="#<? echo $webs[bgcolor_rechts] ?>"><?= $code[$i] ?></td>
                                        <td bgcolor="#<? echo $webs[bgcolor_rechts] ?>"><input type="checkbox" name="check[]" value="<?= $email[$i] ?>" /></td>
                        </tr>
<?php
    }
?>
                        <tr>
                                <td bgcolor="#<? echo $webs[bgcolor_links] ?>"></td>
                                <td bgcolor="#<? echo $webs[bgcolor_rechts] ?>"colspan="3" bgcolor="#<? echo
    $webs[bgcolor_links] ?>"><div align="right"><input type="submit" name="delete" value="Eintrag l&ouml;schen" /></div></td>
                        </tr>
                </table> 
        </form>
</body>
</html>