|
@ -5,14 +5,76 @@ |
|
|
* @version $Id$ |
|
|
* @version $Id$ |
|
|
**/ |
|
|
**/ |
|
|
|
|
|
|
|
|
NaglowekPA('Listowanie galerii'); |
|
|
|
|
|
|
|
|
|
|
|
$sql = "SELECT * FROM `photos` $limit"; |
|
|
$sql = "SELECT * FROM `photos` $limit"; |
|
|
if (!$result = $DB->query($sql)) |
|
|
if (!$result = $DB->query($sql)) |
|
|
{ |
|
|
{ |
|
|
blad('Nie mozna pobrac zdjec uzytkownikow!'); |
|
|
blad('Nie mozna pobrac zdjec uzytkownikow!'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (isset($_POST['nick'])) |
|
|
|
|
|
{ |
|
|
|
|
|
$_POST['nick'] = addslashes(strip_tags(trim($_POST['nick']))); |
|
|
|
|
|
$_POST['email'] = addslashes(strip_tags(trim($_POST['email']))); |
|
|
|
|
|
|
|
|
|
|
|
#sprawdzanie, czy nick nie jest zajety
|
|
|
|
|
|
$sql = "SELECT `id` FROM `admins` WHERE `nick` ='".$_POST['nick']."';"; |
|
|
|
|
|
if (!$result = $DB->query($sql)) |
|
|
|
|
|
{ |
|
|
|
|
|
blad('Nie mozna sprawdzic, czy nick nie zostal zajety.'); |
|
|
|
|
|
} |
|
|
|
|
|
if ($result->num_rows>0) |
|
|
|
|
|
{ |
|
|
|
|
|
$reserved = true; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
$reserved = false; |
|
|
|
|
|
} |
|
|
|
|
|
$result->free(); |
|
|
|
|
|
|
|
|
|
|
|
if (strlen($_POST['nick']) > 0 && trim($_POST['nick']) != $row['nick'] && ~$reserved) |
|
|
|
|
|
{ |
|
|
|
|
|
$sql = "UPDATE `admins` SET `nick`='".$_POST['nick']."' WHERE `id`='$id'"; |
|
|
|
|
|
if (!$DB->query($sql)) |
|
|
|
|
|
{ |
|
|
|
|
|
blad('Nie mozna zaaktualizowac nicku administratora.'); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (strlen($_POST['email']) > 0 && trim($_POST['nick']) != $row['email']) |
|
|
|
|
|
{ |
|
|
|
|
|
if (ereg ("^.+@.+\..+$", $_POST['email'])) |
|
|
|
|
|
{ |
|
|
|
|
|
$sql = "UPDATE `admins` SET `email`='".$_POST['email']."' WHERE `id`='$id'"; |
|
|
|
|
|
if (!$DB->query($sql)) |
|
|
|
|
|
{ |
|
|
|
|
|
blad('Nie mozna zaaktualizowac emaila administratora.'); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
$msg = 'Adres email jest nieprawidłowy! (przykład: [email protected])'; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (strlen(trim($_POST['pass'])) > 0 && md5(trim($_POST['pass'])) != $row['password']) |
|
|
|
|
|
{ |
|
|
|
|
|
$_POST['pass'] = md5(addslashes(strip_tags(trim($_POST['pass'])))); |
|
|
|
|
|
$sql = "UPDATE `admins` SET `password`='".$_POST['pass']."' WHERE `id`='$id'"; |
|
|
|
|
|
if (!$DB->query($sql)) |
|
|
|
|
|
{ |
|
|
|
|
|
blad('Nie mozna zaaktualizowac hasla administratora.'); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ($msg == '') |
|
|
|
|
|
{ |
|
|
|
|
|
Przekieruj('index.php?mode=admin_users', 'Użytkownik został zaaktualizowany! Powrót...'); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
NaglowekPA('Listowanie galerii'); |
|
|
?>
|
|
|
?>
|
|
|
<br /> |
|
|
<br /> |
|
|
<br /> |
|
|
<br /> |
|
@ -42,7 +104,7 @@ while ($row = $result->fetch_assoc()) |
|
|
<?php } ?>
|
|
|
<?php } ?>
|
|
|
</table> |
|
|
</table> |
|
|
<div align="left">Strony: <?php GenerujListeStron(); ?></div>
|
|
|
<div align="left">Strony: <?php GenerujListeStron(); ?></div>
|
|
|
<div align="right"><a href="index.php?mode=admin_users&submode=add">Dodaj nowego użytkownika...</a></div> |
|
|
|
|
|
|
|
|
<div align="right"><a href="index.php?mode=admin_gallery&submode=add">Dodaj nowe zdjęcie...</a></div> |
|
|
<?php StopkaPA(); ?>
|
|
|
<?php StopkaPA(); ?>
|
|
|
|
|
|
|
|
|
<? |
|
|
<? |
|
|