Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
3 lars 1
<?php
2
// +------------------------------------------------------------------------+
3
// | Content_Active                                                         |
4
// +------------------------------------------------------------------------+
5
// | Copyright (c) 2000-2007 Markus Niewerth                                |
6
// | Email         markus@niewerth.com                                      |
7
// | Web           http://www.gamerzzone.de                                 |
8
// | Mirror        http://content-active.gamerzzone.de                          |
9
// +------------------------------------------------------------------------+
10
// | This source file is subject to version 3.00 of the PHP License,        |
11
// | that is available at http://www.php.net/license/3_0.txt.               |
12
// | If you did not receive a copy of the PHP license and are unable to     |
13
// | obtain it through the world-wide-web, please send a note to            |
14
// | license@php.net so we can mail you a copy immediately.                 |
15
// +------------------------------------------------------------------------+
16
// | License Informations                                                   |
17
// +------------------------------------------------------------------------+
18
// | Copyright (c) 2000-2007,Markus Niewerth                                |
19
// | All rights reserved.                                                   |
20
// |                                                                        |
21
// | Redistribution and use in source and binary forms, with or without     |
22
// | modification, are permitted provided that the following conditions     |
23
// | are met:                                                               |
24
// |                                                                        |
25
// | o Redistributions of source code must retain the above copyright       |
26
// |   notice, this list of conditions and the following disclaimer.        |
27
// | o Redistributions in binary form must reproduce the above copyright    |
28
// |   notice, this list of conditions and the following disclaimer in the  |
29
// |   documentation and/or other materials provided with the distribution. |
30
// | o The names of the authors may not be used to endorse or promote       |
31
// |   products derived from this software without specific prior written   |
32
// |   permission.                                                          |
33
// |                                                                        |
34
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS    |
35
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT      |
36
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR  |
37
// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT   |
38
// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,  |
39
// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT       |
40
// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,  |
41
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY  |
42
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT    |
43
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE  |
44
// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.   |
45
// |                                                                        |
46
// +------------------------------------------------------------------------+
47
// | Author: Markus Niewerth <markus@niewerth.com>                          |
48
// +------------------------------------------------------------------------+
49
error_reporting(E_ALL & ~E_NOTICE);
50
ini_set("register_globals", "On");
51
 
52
$baseConfig['emailconfig.default.inc.php'] = "local_s/__classes/";
53
 
54
 //require(substr(PHP_OS, 0, 3)=='WIN' ? 'config.php' : 'config.php');
55
 
56
require_once('local_s/__classes/Email_Safe.class.php');
57
 
58
 
59
 
60
/*
61
if (!file_exists("email.conf.php"))
62
	$eSafe->copyConfig();
63
$eSafe->add("markus@gamerzzone.de");
64
*/
65
 
66
$self=basename($PHP_SELF);
67
$action = $_GET['action'];
68
// -------------------------
69
// Email config file
70
$emailConfig = "emailconfig.inc.php";
71
// -------------------------
72
 
73
// -------------------------
74
 
75
function pre($arr) {
76
	print("<pre>");
77
	print_r($arr);
78
	print("</pre>");
79
}
80
 
81
// pre($_POST);
82
 
83
if ($_POST['create_config'] && $_POST['ID']) {
84
	$dest = $_POST['webPath'].$_POST['sourceConfig'];
85
	$base = $baseConfig[$_POST['sourceConfig']].$_POST['sourceConfig'];
86
	$eSafe = &new Email_Safe($dest);
87
 
88
	if (!file_exists($dest))
89
		$eSafe->copyConfig(false,$base);
90
 
91
	$print = NULL;
92
 
93
	foreach($_POST['attach'] AS $email) {
94
		if (!empty($email)) {
95
			if ( $erg = $eSafe->add($email) )
96
				$print .= "Hinzugef&uuml;gt: $email, <br>Code: <input type='text'  size='40' value='".md5($email)."'><hr>\n";
97
		}
98
	}
99
	//
100
	if(isset($erg)) {
101
		$print .=  "<hr><textarea name=\"textarea\" id=\"textarea\" cols=\"60\" wrap=\"off\" rows=\"".(sizeof($erg)+5)."\">".@implode("",$erg)."</textarea>";
102
	}
103
}
104
 
105
?>
106
 
107
 
108
 
109
<script language="JavaScript">
110
<!--
111
 
112
function MM_swapImgRestore() { //v3.0
113
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
114
}
115
 
116
function MM_preloadImages() { //v3.0
117
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
118
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
119
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
120
}
121
 
122
function MM_swapImage() { //v3.0
123
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
124
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
125
}
126
 
127
function MM_findObj(n, d) { //v4.01
128
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
129
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
130
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
131
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
132
  if(!x && d.getElementById) x=d.getElementById(n); return x;
133
}
134
function addAttach(obj)
135
{
136
	source=document.getElementById(obj)
137
	clone=source.cloneNode(true);
138
	clone.removeAttribute("id");
139
 
140
	source.parentNode.appendChild(clone);
141
}
142
 
143
function removeAttach(obj)
144
{
145
	div = obj.parentNode;
146
	td = obj.parentNode.parentNode;
147
	if (!div.id)  { td.removeChild(div); }
148
}
149
 
150
function removeEmail(obj)
151
{
152
	obj=document.getElementById(obj)
153
	div = obj.parentNode;
154
	td = obj.parentNode.parentNode;
155
	if (!div.id)  { td.removeChild(div); }
156
}
157
//-->
158
</script>
159
<style type="text/css">
160
<!--
161
.Stil1 {color: #FFFFFF}
162
-->
163
</style>
164
<body bgcolor="#FFFFFF" leftmargin="20" topmargin="10" marginwidth="20" marginheight="10" text="#000096">
165
<form method="post" action="#" name="formname" enctype="multipart/form-data">
166
  <table width="662" border="0" cellspacing="0" cellpadding="0">
167
    <tr valign="top">
168
      <td width="585">
169
<!--  Auswahl Löschen START  --><!--  Auswahl SELECT_EDIT ENDE  -->
170
 
171
<?
172
	if ($_GET['action']=="edit")
173
	{
174
	?>
175
	    <table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#FFFFFF" bordercolordark="#999999">
176
          <tr bgcolor="#000099">
177
            <td colspan="2" class="headline Stil1">Email Konfiguration:
178
              <?
179
					if ($_POST['configFile'] || ($_POST['sourceConfig'] && $_POST['create_config']))
180
					{
181
					 ?>
182
              Bearbeiten
183
              <?
184
					}
185
					else
186
					{
187
					 ?>
188
              Erstellen
189
              <?
190
					}
191
				?>            </td>
192
          </tr>
193
          <tr>
194
            <td valign="top" bgcolor="#000099" class="headline Stil1">Basis:</td>
195
            <td>
196
			  <?php
197
					if ($_POST['sourceConfig']) {
198
			  ?>
199
              <input name="configFile" type="text" id="configFile" value="<?php echo $baseConfig[$_POST['sourceConfig']].$_POST['sourceConfig'] ?>" size="40">
200
			  <?php
201
					} elseif ($_POST['configFile']) {
202
 
203
			  ?>
204
              <input name="configFile" type="text" id="configFile" value="<?php echo $_POST['configFile'] ?>" size="40">
205
			  <?php
206
					} else {
207
			  ?>
208
              <input name="configFile" type="text" id="configFile" size="40">
209
			  <?php
210
					}
211
			  ?>
212
			  <? if (!($_POST['sourceConfig'] && $_POST['create_config'])) { ?>
213
              <br>
214
              <input name="create_config" type="checkbox" id="create_config" value="create">
215
              Konfig neu erstellen auf Basis von
216
              <select name="sourceConfig" id="sourceConfig">
217
                <?php
218
					foreach (array_keys($baseConfig) AS $fileName) {
219
				?>
220
                <option>
221
                  <?= $fileName ?>
222
                </option>
223
                <?php
224
					}
225
				?>
226
              </select>
227
              <? } else { ?>
228
 				<br />
229
			  WebPfad:
230
 				<input name="webPath" type="text" id="webPath" value="<?= $_POST['webPath'] ?>">
231
              <input name="create_config" type="hidden" id="create_config" value="<?php echo $_POST['create_config'] ?>">
232
              <input name="sourceConfig" type="hidden" id="sourceConfig" value="<?php echo $_POST['sourceConfig'] ?>">
233
              <? } ?>              </td>
234
          </tr>
235
		  <!-- Emails -->
236
		  <?php
237
		  		if (is_array($eMails) && sizeof($eMails) > 0) {
238
					foreach (array_keys($eMails) AS $emailID) {
239
		  ?>
240
		  <div id="mailList">
241
          <tr>
242
            <td width="13%" valign="top" bgcolor="#000099" class="headline Stil1">Vorhandene:</td>
243
			<td>
244
 
245
			  <input name="attach[]" type="text" id="attach[]" value="<?= $eMails[$emailID] ?>">
246
			  <input type="button" value=" - " onClick="removeMail('mailList')">
247
			  <textarea name="textarea" cols="45" rows="5" wrap="off" id="textarea"></textarea>           </td>
248
          </tr>
249
		  </div>
250
		  <?php
251
		  			}
252
		  		}
253
		  ?>
254
          <tr>
255
            <td width="13%" valign="top" bgcolor="#000099" class="headline Stil1">Add Email:</td>
256
			<td>
257
			<div id="mailAttach">
258
			  <input name="attach[]" type="text" id="attach[]">
259
			  <input type="button" value=" + " onClick="addAttach('mailAttach')">
260
			  <input type="button" value=" - " onClick="removeAttach(this)">
261
			</div>			</td>
262
          </tr>
263
          <!-- // Emails Ende  -->
264
          <tr bgcolor="#000099">
265
            <td align="right" colspan="2">
266
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
267
                <tr>
268
                  <td width="13%">&nbsp;                    </td>
269
                  <td width="87%" align="right">
270
                    <input name="ID" type="hidden" id="ID" value="<?php echo $_POST['configFile'] ?>">
271
                    <input type="hidden" name="action" value="update">
272
                    <input type="submit" value="OK">
273
                    <input type="reset" name="Button" value="Zur&uuml;cksetzen">                  </td>
274
                </tr>
275
				<?php
276
               		 if ($print) {
277
                ?>
278
                <tr bordercolorlight="#FFFFFF" bordercolordark="#999999">
279
                  <td valign="top" bgcolor="#000099" class="headline Stil1">Ergebnis:</td>
280
                  <td bgcolor="#FFFFFF"><?= $print ?>                  </td>
281
                </tr>
282
				<?php
283
               		 }
284
                ?>
285
            </table>
286
            </td>
287
          </tr>
288
        </table>
289
 
290
<?
291
	}
292
?> </td>
293
      <td width="77" align="right">
294
        <table width="67" border="1" cellspacing="0" cellpadding="0" bordercolorlight="#FFFFFF" bordercolordark="#999999">
295
  		<tr>
296
            <td class="frame"><a href="<? echo $self ?>?action=edit" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image5','','images/navigation/bt_neu_f2.gif',1)"><img name="Image5" border="0" src="images/navigation/bt_neu.gif" width="67" height="40"></a></td>
297
  		</tr>
298
 	 	<tr>
299
            <td class="frame"><a href="<? echo $self ?>?action=select_edit" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image6','','images/navigation/bt_bearbeiten_f2.gif',1)"><img name="Image6" border="0" src="images/navigation/bt_bearbeiten.gif" width="67" height="40"></a></td>
300
  		</tr>
301
  		<tr>
302
            <td class="frame"><a href="<? echo $self ?>?action=delete" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image7','','images/navigation/bt_delete_f2.gif',1)"><img name="Image7" border="0" src="images/navigation/bt_delete.gif" width="67" height="40"></a></td>
303
  		</tr>
304
  		<tr>
305
  		  <td class="frame"><a href="<? echo $self ?>?action=check" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('999','','images/navigation/bt_neu_f2.gif',1)"><img src="images/navigation/bt_neu.gif" alt="Check Webs" name="Image5" width="67" height="40" border="0"></a></td>
306
		  </tr>
307
		</table>
308
      </td>
309
</tr>
310
</table>
311
</form>
312
</body>
313