| 1 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
* @package Content-management
|
|
|
5 |
* @author Lars Tiefland <tiefland@weban.de>
|
|
|
6 |
* @copyright 2010 Webagentur Niewerth
|
|
|
7 |
* @license propietary http://www.weban.de
|
|
|
8 |
* @version $Rev: 4010 $
|
|
|
9 |
* @filesource
|
|
|
10 |
*
|
|
|
11 |
*/
|
|
|
12 |
|
|
|
13 |
/**
|
|
|
14 |
*
|
|
|
15 |
* @package Content-management
|
|
|
16 |
* @author Lars Tiefland <tiefland@weban.de>
|
|
|
17 |
* @copyright 2010 Webagentur Niewerth
|
|
|
18 |
*/
|
|
|
19 |
|
|
|
20 |
// SVN: $Id: logins.php 4010 2011-10-21 21:52:41Z www-data $
|
|
|
21 |
|
|
|
22 |
define( "Range", 100 );
|
|
|
23 |
$self = basename( $PHP_SELF );
|
|
|
24 |
$DB = "Logins";
|
|
|
25 |
define( "modul_name", "logins" );
|
|
|
26 |
define( "tool_name", "admin" );
|
|
|
27 |
require_once "../toolbox/common.php";
|
|
|
28 |
require_once "smarty/libs/SmartyPaginate.class.php";
|
|
|
29 |
if ( !$_GET["ID"] )
|
|
|
30 |
{
|
|
|
31 |
require_once "includes/pagination.php";
|
|
|
32 |
}
|
|
|
33 |
$GLOBALS["ui"]->compile_id = "logins|" . $webs["ID"];
|
|
|
34 |
|
|
|
35 |
$action = $_REQUEST["action"];
|
|
|
36 |
$suchname = $_REQUEST["suchname"];
|
|
|
37 |
$select = $_REQUEST["select"];
|
|
|
38 |
$sort = $_REQUEST["sort"];
|
|
|
39 |
$ex_knr = $_REQUEST["ex_knr"];
|
|
|
40 |
$GLOBALS["ui"]->assign( "ex_knr", $ex_knr );
|
|
|
41 |
$GLOBALS["ui"]->assign( "cur_kat", $select );
|
|
|
42 |
$GLOBALS["ui"]->assign( "suchname", $suchname );
|
|
|
43 |
$start = ( $_REQUEST["start"] ) ? $_REQUEST["start"] : 0;
|
|
|
44 |
|
|
|
45 |
unset( $_POST["pwdcheck"] );
|
|
|
46 |
|
|
|
47 |
if ( $_POST["action"] == "import" )
|
|
|
48 |
{
|
|
|
49 |
srand( ( double )microtime() * 1000000 );
|
|
|
50 |
|
|
|
51 |
$filename = "/web/apache/temp/" . $site . "_" . rand() .
|
|
|
52 |
"_importliste.cvs";
|
|
|
53 |
|
|
|
54 |
move_uploaded_file( $_FILES['import_file']['tmp_name'], $filename );
|
|
|
55 |
chmod( $filename, 0777 );
|
|
|
56 |
|
|
|
57 |
$queries = array();
|
|
|
58 |
$queries[] = "delete from $DB;";
|
|
|
59 |
$queries[] = "LOAD DATA INFILE \"" . $filename . "\" INTO TABLE $DB FIELDS TERMINATED BY ';' IGNORE 1 LINES (" .
|
|
|
60 |
$web_rechte[modul_name][tool_name]["import_feldliste"] . ");";
|
|
|
61 |
$queries[] = "update $DB set erstellt_von='$PHP_AUTH_USER', erstellt_am=NOW(), letzte_Aenderung_von='$PHP_AUTH_USER'";
|
|
|
62 |
foreach ( $queries as $query )
|
|
|
63 |
{
|
|
|
64 |
mysql_query( $query ) or die( mysql_errno() . ": " . mysql_error
|
|
|
65 |
() . "<hr>" . $query . "<hr>" );
|
|
|
66 |
}
|
|
|
67 |
|
|
|
68 |
unlink( $filename );
|
|
|
69 |
}
|
|
|
70 |
|
|
|
71 |
if ( $action == "update" )
|
|
|
72 |
{
|
|
|
73 |
$mail = false;
|
|
|
74 |
if ( !$ID )
|
|
|
75 |
{ // insert Dummy-Entry
|
|
|
76 |
$query = "insert into $DB (erstellt_am,erstellt_von) VALUES (NOW(),'$PHP_AUTH_USER')";
|
|
|
77 |
$result = mysql_query( $query ) or die( mysql_errno() . ": " .
|
|
|
78 |
mysql_error() . "<hr>" . $query . "<hr>" );
|
|
|
79 |
$ID = mysql_insert_id();
|
|
|
80 |
if ( file_exists( "$site.xml" ) && isset( $_POST["send_mail"] ) )
|
|
|
81 |
{
|
|
|
82 |
$mail = true;
|
|
|
83 |
}
|
|
|
84 |
}
|
|
|
85 |
|
|
|
86 |
unset( $_POST["action"] );
|
|
|
87 |
unset( $_POST["ID"] );
|
|
|
88 |
if ( $_POST["passwd"] )
|
|
|
89 |
{
|
|
|
90 |
if ( !function_exists( "hash" ) )
|
|
|
91 |
{
|
|
|
92 |
switch ( strtolower( $web_rechte[modul_name][tool_name]["passwd"] ) )
|
|
|
93 |
{
|
|
|
94 |
case "sha1":
|
|
|
95 |
$_POST["passwd"] = sha1( $_POST["passwd"] );
|
|
|
96 |
break;
|
|
|
97 |
case "md5":
|
|
|
98 |
$_POST["passwd"] = md5( $_POST["passwd"] );
|
|
|
99 |
break;
|
|
|
100 |
case "crypt":
|
|
|
101 |
default:
|
|
|
102 |
$_POST["passwd"] = crypt( $_POST["passwd"] );
|
|
|
103 |
break;
|
|
|
104 |
}
|
|
|
105 |
} elseif ( in_array( strtolower( $web_rechte[modul_name][tool_name]["passwd"] ),
|
|
|
106 |
hash_algos() ) )
|
|
|
107 |
{
|
|
|
108 |
$_POST["passwd"] = hash( $web_rechte[modul_name][tool_name]["passwd"],
|
|
|
109 |
$_POST["passwd"] );
|
|
|
110 |
} elseif ( strtolower( $web_rechte[modul_name][tool_name]["passwd"] ) == "" ||
|
|
|
111 |
strtolower( $web_rechte[modul_name][tool_name]["passwd"] ) ==
|
|
|
112 |
"crypt" )
|
|
|
113 |
{
|
|
|
114 |
$_POST["passwd"] = crypt( $_POST["passwd"] );
|
|
|
115 |
}
|
|
|
116 |
}
|
|
|
117 |
else
|
|
|
118 |
{
|
|
|
119 |
unset( $_POST["passwd"] );
|
|
|
120 |
}
|
|
|
121 |
|
|
|
122 |
foreach ( array_keys( $_POST ) as $elem )
|
|
|
123 |
{
|
|
|
124 |
if ( in_array( $elem, array( "Datum1", "Datum2",
|
|
|
125 |
"Eintrittsdatum", "Austrittsdatum", "Beitrag_bezahlt",
|
|
|
126 |
"Beitrag_letztes", "Mitgliedskarte" ) ) )
|
|
|
127 |
{
|
|
|
128 |
$_POST[$elem] = human2date( $_POST[$elem] );
|
|
|
129 |
}
|
|
|
130 |
|
|
|
131 |
if ( $elem[0] == "_" )
|
|
|
132 |
{
|
|
|
133 |
unset( $_POST[$elem] );
|
|
|
134 |
$button = $$elem;
|
|
|
135 |
$elem = substr( $elem, 1 );
|
|
|
136 |
$Pfad = $_POST[$elem . "_Pfad"];
|
|
|
137 |
unset( $_POST[$elem . "_Pfad"] );
|
|
|
138 |
$image = $$elem;
|
|
|
139 |
$image_name = $elem . "_name";
|
|
|
140 |
$image_name = urlencode( $$image_name );
|
|
|
141 |
switch ( $button )
|
|
|
142 |
{
|
|
|
143 |
case 0:
|
|
|
144 |
break;
|
|
|
145 |
case 1:
|
|
|
146 |
$_POST[$elem] = '';
|
|
|
147 |
break;
|
|
|
148 |
case 2:
|
|
|
149 |
//$image_name=$ID."_".$image_name;
|
|
|
150 |
// copy( $image, $Pfad . $image_name );
|
|
|
151 |
|
|
|
152 |
// $Imagenummer extrahieren
|
|
|
153 |
$Imagenummer = explode( "_", $elem );
|
|
|
154 |
$Imagenummer = $Imagenummer[1];
|
|
|
155 |
$DatenID = "bild" . $Imagenummer;
|
|
|
156 |
|
|
|
157 |
//$web_rechte[modul_name][tool_name][$DatenID] = "Bild:;500;500;180x180;180;180;120x120;120;120;80x120;80;120;30x30;30;30";
|
|
|
158 |
|
|
|
159 |
$Imagedaten = array_chunk( explode( ";", $web_rechte[modul_name][tool_name][$DatenID] ),
|
|
|
160 |
3 );
|
|
|
161 |
$Imagedaten[0][0] = "";
|
|
|
162 |
|
|
|
163 |
// Höhe und Breite des Bildes bestimmen
|
|
|
164 |
$imgsize = GetImageSize( $image );
|
|
|
165 |
// $imgsize[0] $imgsize[1]
|
|
|
166 |
|
|
|
167 |
$image_name = $ID . strrchr( $image_name, "." );
|
|
|
168 |
|
|
|
169 |
$_POST[$elem] = $image_name;
|
|
|
170 |
|
|
|
171 |
foreach ( $Imagedaten as $ImagedatenSet )
|
|
|
172 |
{
|
|
|
173 |
if ( $ImagedatenSet[0] != "" )
|
|
|
174 |
{
|
|
|
175 |
$ImagedatenSet[0] .= "/";
|
|
|
176 |
}
|
|
|
177 |
// ---- Hier wird abgefragt ob das Bild verkleinert werden soll ---- //
|
|
|
178 |
if ( count( $ImagedatenSet ) == 3 )
|
|
|
179 |
{
|
|
|
180 |
if ( ( $imgsize[0] > $ImagedatenSet[1] ) or
|
|
|
181 |
( $imgsize[1] > $ImagedatenSet[2] ) )
|
|
|
182 |
{
|
|
|
183 |
$cmd = "convert -scale " . $ImagedatenSet[1] .
|
|
|
184 |
"x" . $ImagedatenSet[2] . " " . $image .
|
|
|
185 |
" " . $Pfad . $ImagedatenSet[0] . $image_name;
|
|
|
186 |
//pre($cmd);
|
|
|
187 |
exec( $cmd );
|
|
|
188 |
}
|
|
|
189 |
else
|
|
|
190 |
{
|
|
|
191 |
copy( $image, $Pfad . $ImagedatenSet[0] .
|
|
|
192 |
$image_name );
|
|
|
193 |
}
|
|
|
194 |
}
|
|
|
195 |
else
|
|
|
196 |
{
|
|
|
197 |
copy( $image, $Pfad . $ImagedatenSet[0] . $image_name );
|
|
|
198 |
}
|
|
|
199 |
}
|
|
|
200 |
break;
|
|
|
201 |
default:
|
|
|
202 |
break;
|
|
|
203 |
}
|
|
|
204 |
} elseif ( $elem == "rabatt" && isset( $user_rechte["logins"]["admin"]["rabatt"] ) )
|
|
|
205 |
{
|
|
|
206 |
if ( stristr( $_POST[$elem], "%" ) )
|
|
|
207 |
{
|
|
|
208 |
$_POST[$elem] *= -1;
|
|
|
209 |
}
|
|
|
210 |
}
|
|
|
211 |
}
|
|
|
212 |
$names = array();
|
|
|
213 |
foreach ( array_keys( $_POST ) as $elem )
|
|
|
214 |
{
|
|
|
215 |
array_push( $names, "$elem='" . mysql_real_escape_string( $_POST[$elem] ) .
|
|
|
216 |
"'" );
|
|
|
217 |
}
|
|
|
218 |
$query = "update $DB set " . join( $names, ', ' );
|
|
|
219 |
$query = $query .
|
|
|
220 |
", letzte_Aenderung_am=NOW(), letzte_Aenderung_von='$PHP_AUTH_USER' where ID = '$ID'";
|
|
|
221 |
$result = mysql_query( $query ) or die( mysql_errno() . ": " .
|
|
|
222 |
mysql_error() );
|
|
|
223 |
if ( $mail )
|
|
|
224 |
{
|
|
|
225 |
require_once "Config.php";
|
|
|
226 |
require_once "../Warenwirtschaft/MailClient/mail_func.php";
|
|
|
227 |
$cfg = new Config();
|
|
|
228 |
$conf = $cfg->parseConfig( $site . ".xml", "xml" );
|
|
|
229 |
if ( PEAR::isError( $conf ) )
|
|
|
230 |
{
|
|
|
231 |
die( $conf->getMessage() );
|
|
|
232 |
}
|
|
|
233 |
$conf = $conf->toArray();
|
|
|
234 |
$text = $conf["root"]["mail"]["text"];
|
|
|
235 |
$subject = $conf["root"]["mail"]["subject"];
|
|
|
236 |
$extra = $conf["root"]["mail"]["extra"];
|
|
|
237 |
$text = sprintf( $text, $_POST["Name1"], $_POST["user"], $_POST["passwd"],
|
|
|
238 |
$url );
|
|
|
239 |
send_email( $_POST["E_Mail"], $subject, $text, $extra );
|
|
|
240 |
}
|
|
|
241 |
header( "Location: " . $self );
|
|
|
242 |
}
|
|
|
243 |
// Bilderupload
|
|
|
244 |
foreach ( array_keys( $_POST ) as $elem )
|
|
|
245 |
{
|
|
|
246 |
if ( $elem[0] == "_" )
|
|
|
247 |
{
|
|
|
248 |
unset( $_POST[$elem] );
|
|
|
249 |
$button = $$elem;
|
|
|
250 |
$elem = substr( $elem, 1 );
|
|
|
251 |
$Pfad = $_POST[$elem . "_Pfad"];
|
|
|
252 |
unset( $_POST[$elem . "_Pfad"] );
|
|
|
253 |
$image = $$elem;
|
|
|
254 |
$image_name = $elem . "_name";
|
|
|
255 |
$image_name = urlencode( $$image_name );
|
|
|
256 |
switch ( $button )
|
|
|
257 |
{
|
|
|
258 |
case 0:
|
|
|
259 |
break;
|
|
|
260 |
case 1:
|
|
|
261 |
$_POST[$elem] = '';
|
|
|
262 |
break;
|
|
|
263 |
case 2:
|
|
|
264 |
$image_name = $ID . "_" . $language . "_" . $image_name;
|
|
|
265 |
//$image_name=$ID.strrchr($image_name,".");
|
|
|
266 |
$_POST[$elem] = $image_name;
|
|
|
267 |
|
|
|
268 |
|
|
|
269 |
// $Imagenummer extrahieren
|
|
|
270 |
$Imagenummer = explode( "_", $elem );
|
|
|
271 |
$Imagenummer = $Imagenummer[1];
|
|
|
272 |
$DatenID = "bild" . $Imagenummer;
|
|
|
273 |
|
|
|
274 |
//$web_rechte[modul_name][tool_name][$DatenID] = "Bild:;500;500;180x180;180;180;120x120;120;120;80x120;80;120;30x30;30;30";
|
|
|
275 |
|
|
|
276 |
$Imagedaten = array_chunk( explode( ";", $web_rechte[modul_name][tool_name][$DatenID] ),
|
|
|
277 |
3 );
|
|
|
278 |
$Imagedaten[0][0] = "";
|
|
|
279 |
/*
|
|
|
280 |
Imagedaten möglich Werte:
|
|
|
281 |
0: Titel des Feldes
|
|
|
282 |
1: max. Breite für Bild1 (original)
|
|
|
283 |
2: max. Höhe für Bild1 (original)
|
|
|
284 |
|
|
|
285 |
3: Pfad für Bild
|
|
|
286 |
4: max. Breite für Bild
|
|
|
287 |
5: max. Höhe für Bild
|
|
|
288 |
|
|
|
289 |
...
|
|
|
290 |
...
|
|
|
291 |
...
|
|
|
292 |
*/
|
|
|
293 |
|
|
|
294 |
// Höhe und Breite des Bildes bestimmen
|
|
|
295 |
$imgsize = GetImageSize( $image );
|
|
|
296 |
// $imgsize[0] $imgsize[1]
|
|
|
297 |
|
|
|
298 |
foreach ( $Imagedaten as $ImagedatenSet )
|
|
|
299 |
{
|
|
|
300 |
if ( $ImagedatenSet[0] != "" )
|
|
|
301 |
{
|
|
|
302 |
$ImagedatenSet[0] .= "/";
|
|
|
303 |
}
|
|
|
304 |
// ---- Hier wird abgefragt ob das Bild verkleinert werden soll ---- //
|
|
|
305 |
if ( count( $ImagedatenSet ) == 3 )
|
|
|
306 |
{
|
|
|
307 |
if ( ( $imgsize[0] > $ImagedatenSet[1] ) or ( $imgsize[1] >
|
|
|
308 |
$ImagedatenSet[2] ) )
|
|
|
309 |
{
|
|
|
310 |
$cmd = "convert -scale " . $ImagedatenSet[1] .
|
|
|
311 |
"x" . $ImagedatenSet[2] . " " . $image .
|
|
|
312 |
" " . $Pfad . $ImagedatenSet[0] . $image_name;
|
|
|
313 |
pre( $cmd );
|
|
|
314 |
exec( $cmd );
|
|
|
315 |
}
|
|
|
316 |
else
|
|
|
317 |
{
|
|
|
318 |
copy( $image, $Pfad . $ImagedatenSet[0] . $image_name );
|
|
|
319 |
}
|
|
|
320 |
}
|
|
|
321 |
else
|
|
|
322 |
{
|
|
|
323 |
copy( $image, $Pfad . $ImagedatenSet[0] . $image_name );
|
|
|
324 |
}
|
|
|
325 |
}
|
|
|
326 |
break;
|
|
|
327 |
default:
|
|
|
328 |
break;
|
|
|
329 |
}
|
|
|
330 |
}
|
|
|
331 |
}
|
|
|
332 |
|
|
|
333 |
if ( $action == "delete" )
|
|
|
334 |
{
|
|
|
335 |
if ( $ID )
|
|
|
336 |
{
|
|
|
337 |
$condition = array();
|
|
|
338 |
$condition2 = array();
|
|
|
339 |
foreach ( $ID as $elem )
|
|
|
340 |
{
|
|
|
341 |
array_push( $condition, " ID = '$elem'" );
|
|
|
342 |
array_push( $condition2, " Logins = '$elem'" );
|
|
|
343 |
}
|
|
|
344 |
$cond = join( " or ", $condition );
|
|
|
345 |
$cond2 = join( " or ", $condition2 );
|
|
|
346 |
|
|
|
347 |
$query = "DELETE FROM $DB WHERE $cond";
|
|
|
348 |
$result = mysql_query( "$query" ) or die( mysql_errno() . ": " .
|
|
|
349 |
mysql_error() );
|
|
|
350 |
|
|
|
351 |
$query = "delete from Logins_to_Verteiler WHERE $cond2";
|
|
|
352 |
$result = mysql_query( "$query" );
|
|
|
353 |
|
|
|
354 |
header( "Location: " . $self );
|
|
|
355 |
}
|
|
|
356 |
}
|
|
|
357 |
|
|
|
358 |
if ( !$action )
|
|
|
359 |
{
|
|
|
360 |
$action = "select_edit";
|
|
|
361 |
$_GET["action"] = $action;
|
|
|
362 |
}
|
|
|
363 |
if ( !$sort )
|
|
|
364 |
{
|
|
|
365 |
$sort = 'Status,user';
|
|
|
366 |
}
|
|
|
367 |
|
|
|
368 |
switch ( $action )
|
|
|
369 |
{
|
|
|
370 |
case "free_php":
|
|
|
371 |
require_once $web_rechte[modul_name][tool_name]["php"];
|
|
|
372 |
break;
|
|
|
373 |
case "import":
|
|
|
374 |
break;
|
|
|
375 |
case "export":
|
|
|
376 |
require_once "export_auswahl.php";
|
|
|
377 |
break;
|
|
|
378 |
case "edit":
|
|
|
379 |
if ( $ID )
|
|
|
380 |
{
|
|
|
381 |
$_GET["login_id"] = $ID;
|
|
|
382 |
unset( $_GET["ID"] );
|
|
|
383 |
if ( isset( $user_rechte["logins"]["admin"]["user_orders"] ) )
|
|
|
384 |
{
|
|
|
385 |
require_once "../Warenwirtschaft/bestellungen_neu.php";
|
|
|
386 |
$GLOBALS["ui"]->assign( "bestellungen_liste", $bestellungen_liste );
|
|
|
387 |
}
|
|
|
388 |
$felder = array( "*" );
|
|
|
389 |
foreach ( array( "Datum1", "Datum2" ) as $fn )
|
|
|
390 |
{
|
|
|
391 |
if ( isset( $user_rechte[modul_name][tool_name][$fn] ) )
|
|
|
392 |
{
|
|
|
393 |
$felder[] = "date_format($fn ,'%d.%m.%Y') as $fn";
|
|
|
394 |
}
|
|
|
395 |
}
|
|
|
396 |
|
|
|
397 |
if ( isset( $user_rechte[modul_name][tool_name]["Vereinsdaten"] ) )
|
|
|
398 |
{
|
|
|
399 |
foreach ( array( "Eintrittsdatum", "Austrittsdatum",
|
|
|
400 |
"Beitrag_bezahlt", "Beitrag_letztes",
|
|
|
401 |
"Mitgliedskarte" ) as $fn )
|
|
|
402 |
{
|
|
|
403 |
$felder[] = "date_format($fn ,'%d.%m.%Y') as $fn";
|
|
|
404 |
}
|
|
|
405 |
}
|
|
|
406 |
|
|
|
407 |
if ( isset( $user_rechte["logins"]["admin"]["rabatt"] ) )
|
|
|
408 |
{
|
|
|
409 |
$felder[] = "rabatt";
|
|
|
410 |
|
|
|
411 |
}
|
|
|
412 |
|
|
|
413 |
$result = mysql_query( "
|
|
|
414 |
SELECT
|
|
|
415 |
" . implode( ", ", $felder ) . "
|
|
|
416 |
FROM
|
|
|
417 |
$DB
|
|
|
418 |
where
|
|
|
419 |
ID = '$ID'
|
|
|
420 |
" ) or die( mysql_errno() . ": " . mysql_error() );
|
|
|
421 |
|
|
|
422 |
|
|
|
423 |
$zeile = mysql_fetch_assoc( $result );
|
|
|
424 |
|
|
|
425 |
if ( $zeile["rabatt"] < 0 && isset( $user_rechte["logins"]["admin"]["rabatt"] ) )
|
|
|
426 |
{
|
|
|
427 |
$zeile["rabatt"] = abs( $zeile["rabatt"] ) . "%";
|
|
|
428 |
}
|
|
|
429 |
|
|
|
430 |
// ME: gibt es Zahlungsziele? START
|
|
|
431 |
if ( isset( $user_rechte[modul_name][tool_name]["zahlungsziel"] ) )
|
|
|
432 |
{
|
|
|
433 |
$sql = "select *
|
|
|
434 |
from
|
|
|
435 |
zahlungsziele
|
|
|
436 |
order by
|
|
|
437 |
ID
|
|
|
438 |
";
|
|
|
439 |
if ( $q = mysql_query( $sql ) )
|
|
|
440 |
{
|
|
|
441 |
while ( $r = mysql_fetch_assoc( $q ) )
|
|
|
442 |
{
|
|
|
443 |
$zahlungsziele[] = $r;
|
|
|
444 |
}
|
|
|
445 |
$GLOBALS["ui"]->assign( "zahlungsziele", $zahlungsziele );
|
|
|
446 |
}
|
|
|
447 |
|
|
|
448 |
}
|
|
|
449 |
// ME: gibt es Zahlungsziele? ENDE
|
|
|
450 |
|
|
|
451 |
$GLOBALS["ui"]->assign( "login", $zeile );
|
|
|
452 |
}
|
|
|
453 |
$GLOBALS["ui"]->assign( "file", "login.tpl" );
|
|
|
454 |
break;
|
|
|
455 |
case "select_edit":
|
|
|
456 |
default:
|
|
|
457 |
$query[] = "SELECT SQL_CALC_FOUND_ROWS * FROM $DB";
|
|
|
458 |
if ( $suchname )
|
|
|
459 |
{
|
|
|
460 |
$search_query[] = "(Name1 like '%$suchname%' OR Vorname LIKE '%$suchname%' OR Name2 LIKE '%$suchname%')";
|
|
|
461 |
}
|
|
|
462 |
if ( $select != " " && $select != "" )
|
|
|
463 |
{
|
|
|
464 |
$search_query[] = "status='$select'";
|
|
|
465 |
}
|
|
|
466 |
if ( $ex_knr )
|
|
|
467 |
{
|
|
|
468 |
$search_query[] = "ex_knr='$ex_knr'";
|
|
|
469 |
}
|
|
|
470 |
if ( $plz )
|
|
|
471 |
{
|
|
|
472 |
$search_query[] = "plz LIKE '$plz%'";
|
|
|
473 |
}
|
|
|
474 |
if ( $search_query )
|
|
|
475 |
{
|
|
|
476 |
$query[] = "WHERE " . implode( " AND ", $search_query );
|
|
|
477 |
}
|
|
|
478 |
$query[] = "
|
|
|
479 |
ORDER BY
|
|
|
480 |
$sort
|
|
|
481 |
LIMIT
|
|
|
482 |
" . SmartyPaginate::getCurrentIndex() . "," . Range . "
|
|
|
483 |
";
|
|
|
484 |
$query = implode( " ", $query );
|
|
|
485 |
$result = mysql_query( $query ) or die( mysql_errno() . ": " .
|
|
|
486 |
mysql_error() . "<hr>$query" );
|
|
|
487 |
while ( $row = mysql_fetch_assoc( $result ) )
|
|
|
488 |
{
|
|
|
489 |
$logins[] = $row;
|
|
|
490 |
}
|
|
|
491 |
$GLOBALS["ui"]->assign( "logins", $logins );
|
|
|
492 |
$sql = "SELECT
|
|
|
493 |
FOUND_ROWS() AS total
|
|
|
494 |
";
|
|
|
495 |
$res = mysql_query( $sql );
|
|
|
496 |
$row = mysql_fetch_assoc( $res );
|
|
|
497 |
$total = $row["total"];
|
|
|
498 |
$GLOBALS["ui"]->assign( "total", $total );
|
|
|
499 |
pagination( $total );
|
|
|
500 |
$format_string = "Name1;, ;PLZ; ;ORT; / ;E_Mail";
|
|
|
501 |
if ( $web_rechte[modul_name][tool_name][edit_string] )
|
|
|
502 |
{
|
|
|
503 |
$format_string = $web_rechte[modul_name][tool_name]["edit_string"];
|
|
|
504 |
}
|
|
|
505 |
$felder = explode( ";", $format_string );
|
|
|
506 |
$GLOBALS["ui"]->assign( "felder", $felder );
|
|
|
507 |
$GLOBALS["ui"]->assign( "file", "logins_select.tpl" );
|
|
|
508 |
break;
|
|
|
509 |
}
|
|
|
510 |
if ( isset( $user_rechte[modul_name][tool_name]["auswahl"] ) )
|
|
|
511 |
{
|
|
|
512 |
|
|
|
513 |
$Feld = "userlevel";
|
|
|
514 |
if ( isset( $user_rechte[modul_name][tool_name][$Feld] ) )
|
|
|
515 |
{
|
|
|
516 |
if ( !$web_rechte[modul_name][tool_name][$Feld] )
|
|
|
517 |
{
|
|
|
518 |
$web_rechte[modul_name][tool_name][$Feld] = " ;1;2;3;4;5;6";
|
|
|
519 |
} elseif ( $web_rechte[modul_name][tool_name][$Feld][0] != " " )
|
|
|
520 |
{
|
|
|
521 |
$web_rechte[modul_name][tool_name][$Feld] = " ;" . $web_rechte[modul_name][tool_name][$Feld];
|
|
|
522 |
}
|
|
|
523 |
}
|
|
|
524 |
$kats = explode( ";", $web_rechte[modul_name][tool_name][$Feld] );
|
|
|
525 |
}
|
|
|
526 |
$GLOBALS["ui"]->assign( "kats", $kats );
|
|
|
527 |
$Feld = "Anrede";
|
|
|
528 |
if ( !$web_rechte[modul_name][tool_name][$Feld] )
|
|
|
529 |
{
|
|
|
530 |
$web_rechte[modul_name][tool_name][$Feld] = " ;Herr;Frau;Firma";
|
|
|
531 |
}
|
|
|
532 |
else
|
|
|
533 |
{
|
|
|
534 |
$web_rechte[modul_name][tool_name][$Feld] = ( substr( stristr( $web_rechte[modul_name][tool_name][$Feld],
|
|
|
535 |
';' ), 1 ) );
|
|
|
536 |
}
|
|
|
537 |
$anreden = explode( ";", $web_rechte[modul_name][tool_name][$Feld] );
|
|
|
538 |
for ( $bild_nr = 1; $bild_nr <= 7; $bild_nr++ )
|
|
|
539 |
{
|
|
|
540 |
$Feld = "bild$bild_nr";
|
|
|
541 |
if ( isset( $user_rechte[modul_name][tool_name][$Feld] ) )
|
|
|
542 |
{
|
|
|
543 |
$Felddaten = explode( ";", $web_rechte[modul_name][tool_name][$Feld] );
|
|
|
544 |
if ( $Felddaten[0] )
|
|
|
545 |
{
|
|
|
546 |
$Bilddaten[$bild_nr]["name"] = $Felddaten[0];
|
|
|
547 |
}
|
|
|
548 |
else
|
|
|
549 |
{
|
|
|
550 |
$Bilddaten[$bild_nr]["name"] = "Bild " . $bild_nr;
|
|
|
551 |
}
|
|
|
552 |
$Bilddaten[$bild_nr]["img_name"] = "bild_" . $bild_nr . "_url";
|
|
|
553 |
$Bilddaten[$bild_nr]["img_Path"] = $webs["verzeichnis"] .
|
|
|
554 |
"/images/Login/Bild_" . $bild_nr . "/";
|
|
|
555 |
if ( substr( $Felddaten[0], 0, 4 ) == "Doku" )
|
|
|
556 |
{
|
|
|
557 |
$Bilddaten[$bild_nr]["typ"] = "Dokument";
|
|
|
558 |
}
|
|
|
559 |
else
|
|
|
560 |
{
|
|
|
561 |
$Bilddaten[$bild_nr]["typ"] = "Bild";
|
|
|
562 |
}
|
|
|
563 |
}
|
|
|
564 |
}
|
|
|
565 |
$GLOBALS["ui"]->assign( "Bilddaten", $Bilddaten );
|
|
|
566 |
$GLOBALS["ui"]->assign( "Language_neueintrag", $Language_neueintrag );
|
|
|
567 |
$GLOBALS["ui"]->assign( "site", $site );
|
|
|
568 |
$GLOBALS["ui"]->assign( "anreden", $anreden );
|
|
|
569 |
$GLOBALS["ui"]->display( "logins.tpl" );
|
|
|
570 |
?>
|