当前位置: 首页>>代码示例>>PHP>>正文


PHP Album::checkPassword方法代码示例

本文整理汇总了PHP中Album::checkPassword方法的典型用法代码示例。如果您正苦于以下问题:PHP Album::checkPassword方法的具体用法?PHP Album::checkPassword怎么用?PHP Album::checkPassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Album的用法示例。


在下文中一共展示了Album::checkPassword方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPublic

 public function getPublic($password)
 {
     # Functions checks if photo or parent album is public
     # Returns the following:
     # (int) 0 = Photo private and parent album private
     # (int) 1 = Album public, but password incorrect
     # (int) 2 = Photo public or album public and password correct
     # Check dependencies
     self::dependencies(isset($this->database, $this->photoIDs));
     # Call plugins
     $this->plugins(__METHOD__, 0, func_get_args());
     # Get photo
     $query = Database::prepare($this->database, "SELECT public, album FROM ? WHERE id = '?' LIMIT 1", array(LYCHEE_TABLE_PHOTOS, $this->photoIDs));
     $photos = $this->database->query($query);
     $photo = $photos->fetch_object();
     # Check if public
     if ($photo->public === '1') {
         # Photo public
         return 2;
     } else {
         # Check if album public
         $album = new Album($this->database, null, null, $photo->album);
         $agP = $album->getPublic();
         $acP = $album->checkPassword($password);
         # Album public and password correct
         if ($agP === true && $acP === true) {
             return 2;
         }
         # Album public, but password incorrect
         if ($agP === true && $acP === false) {
             return 1;
         }
     }
     # Call plugins
     $this->plugins(__METHOD__, 1, func_get_args());
     # Photo private
     return 0;
 }
开发者ID:thejandroman,项目名称:Lychee,代码行数:38,代码来源:Photo.php

示例2: getPublic

 public function getPublic($password)
 {
     # Check dependencies
     self::dependencies(isset($this->database, $this->photoIDs));
     # Call plugins
     $this->plugins(__METHOD__, 0, func_get_args());
     # Get photo
     $query = Database::prepare($this->database, "SELECT public, album FROM ? WHERE id = '?' LIMIT 1", array(LYCHEE_TABLE_PHOTOS, $this->photoIDs));
     $photos = $this->database->query($query);
     $photo = $photos->fetch_object();
     # Check if public
     if ($photo->public == 1) {
         return true;
     } else {
         $album = new Album($this->database, null, null, $photo->album);
         $acP = $album->checkPassword($password);
         $agP = $album->getPublic();
         if ($acP === true && $agP === true) {
             return true;
         }
     }
     # Call plugins
     $this->plugins(__METHOD__, 1, func_get_args());
     return false;
 }
开发者ID:fredrikcarno,项目名称:Lychee,代码行数:25,代码来源:Photo.php

示例3: getAlbumArchive

 private function getAlbumArchive()
 {
     Module::dependencies(isset($_GET['albumID'], $_GET['password']));
     $album = new Album($this->database, $this->plugins, $this->settings, $_GET['albumID']);
     if ($album->getPublic() && $album->getDownloadable()) {
         # Album Public
         if ($album->checkPassword($_GET['password'])) {
             $album->getArchive();
         } else {
             exit('Warning: Wrong password!');
         }
     } else {
         # Album Private
         exit('Warning: Album private or not downloadable!');
     }
 }
开发者ID:thejandroman,项目名称:Lychee,代码行数:16,代码来源:Guest.php

示例4: getPublic

 public function getPublic($password)
 {
     Log::notice($this->database, __METHOD__, __LINE__, "Checking public for " . $this->photoIDs);
     # Functions checks if photo or parent album is public
     # Returns the following:
     # (int) 0 = Photo private and parent album private
     # (int) 1 = Album public, but password incorrect
     # (int) 2 = Photo public or album public and password correct
     # Check dependencies
     self::dependencies(isset($this->database, $this->photoIDs));
     # Call plugins
     $this->plugins(__METHOD__, 0, func_get_args());
     # Get photo
     $stmt = $this->database->prepare("SELECT public, album FROM " . LYCHEE_TABLE_PHOTOS . " WHERE id = ? LIMIT 1");
     $result = $stmt->execute(array($this->photoIDs));
     $photo = $stmt->fetchObject();
     # Check if public
     if ($photo->public == 1) {
         # Photo public
         return 2;
     } else {
         # Check if album public
         $album = new Album($this->database, null, null, $photo->album);
         $agP = $album->getPublic();
         $acP = $album->checkPassword($password);
         # Album public and password correct
         if ($agP === true && $acP === true) {
             return 2;
         }
         # Album public, but password incorrect
         if ($agP === true && $acP === false) {
             return 1;
         }
     }
     # Call plugins
     $this->plugins(__METHOD__, 1, func_get_args());
     # Photo private
     return 0;
 }
开发者ID:rssc,项目名称:Lychee,代码行数:39,代码来源:Photo.php

示例5: getPublic

 public function getPublic($password)
 {
     # Functions checks if photo or parent album is public
     # Returns the following:
     # (int) 0 = Photo private and parent album private
     # (int) 1 = Album public, but password incorrect
     # (int) 2 = Photo public or album public and password correct
     # Check dependencies
     self::dependencies(isset($this->photoIDs));
     # Get photo
     $sql = "SELECT public, album FROM photos WHERE id = " . pg_escape_literal($this->photoIDs);
     $res = pg_query($db, $sql);
     $row = pg_fetch_array($res);
     # Check if public
     if ($row['public'] === '1') {
         # Photo public
         pg_free_result($res);
         return 2;
     } else {
         # Check if album public
         $album = new Album(null, null, $row['album']);
         $agP = $album->getPublic();
         $acP = $album->checkPassword($password);
         # Album public and password correct
         if ($agP === true && $acP === true) {
             pg_free_result($res);
             return 2;
         }
         # Album public, but password incorrect
         if ($agP === true && $acP === false) {
             pg_free_result($res);
             return 1;
         }
     }
     pg_free_result($res);
     # Photo private
     return 0;
 }
开发者ID:waitman,项目名称:Lychee,代码行数:38,代码来源:Photo.php


注:本文中的Album::checkPassword方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。