Esempio n. 1
0
             $authType = "zp_album_auth_" . $albumobj->get('id');
             $hint = $albumobj->getPasswordHint();
             $show = $albumobj->getUser();
             if (!empty($hash)) {
                 break;
             }
             $albumobj = $albumobj->getParent();
         }
     }
 }
 if (empty($hash)) {
     // check for gallery password
     $hash = $_zp_gallery->getPassword();
     $authType = 'zp_gallery_auth';
     $hint = $_zp_gallery->getPasswordHint();
     $show = $_zp_gallery->getUser();
 }
 if (empty($hash) && GALLERY_SECURITY == 'private' || !empty($hash) && zp_getCookie($authType) != $hash) {
     require_once dirname(__FILE__) . "/template-functions.php";
     $parms = '';
     if (isset($_GET['wmk'])) {
         $parms = '&wmk=' . $_GET['wmk'];
     }
     if (isset($_GET['q'])) {
         $parms .= '&q=' . sanitize_numeric($_GET['q']);
     }
     if (isset($_GET['dsp'])) {
         $parms .= '&dsp=' . sanitize_numeric($_GET['dsp']);
     }
     $action = WEBPATH . '/' . ZENFOLDER . '/full-image.php?userlog=1&a=' . pathurlencode($album8) . '&i=' . urlencode($image8) . $parms;
     printPasswordForm($hint, true, $_zp_gallery->getUserLogonField() || $show, $action);
Esempio n. 2
0
 if ($st == 'manual' || $st == 'random') {
     $gallery->setSortDirection(0);
 } else {
     $gallery->setSortDirection((int) isset($_POST['gallery_sortdirection']));
 }
 foreach ($_POST as $item => $value) {
     if (strpos($item, 'gallery-page_') === 0) {
         $item = sanitize(substr(postIndexDecode($item), 13));
         $gallery->setUnprotectedPage($item, (int) isset($_POST['gallery_page_unprotected_' . $item]));
     }
 }
 $gallery->setSecurity(sanitize($_POST['gallery_security'], 3));
 $gallery->setUserLogonField(isset($_POST['login_user_field']));
 setOption('edit_in_place', (int) (sanitize_numeric($_POST['edit_in_place']) && true));
 if ($_POST['password_enabled']) {
     $olduser = $gallery->getUser();
     $newuser = trim(sanitize($_POST['gallery_user'], 3));
     if (!empty($newuser)) {
         $gallery->setUserLogonField(1);
     }
     $pwd = trim(sanitize($_POST['gallerypass']));
     $fail = '';
     if ($olduser != $newuser) {
         if (!empty($newuser) && empty($pwd) && empty($pwd2)) {
             $fail = '?mismatch=user_gallery';
         }
     }
     if (!$fail && $_POST['gallerypass'] == $_POST['gallerypass_2']) {
         $gallery->setUser($newuser);
         if (empty($pwd)) {
             if (empty($_POST['gallerypass'])) {