<?php include 'cd.php'; ini_set('max_execution_time', '3600'); ob_start(); $CurrentUser = Authentication::Authenticate(); if (!$CurrentUser->hasPermission(RIGHT_EXPORT_CSV)) { $e = new Error(RIGHTS_ERR_USERNOTALLOWED); Error::AddError($e); HTMLstuff::RefererRedirect(); } $ModelID = Utils::SafeIntFromQS('model_id'); $includepath = Utils::SafeIntFromQS('includepath'); $includepath = in_array($includepath, array(EXPORT_PATH_OPTION_NONE, EXPORT_PATH_OPTION_RELATIVE, EXPORT_PATH_OPTION_FULL)) ? $includepath : EXPORT_PATH_OPTION_NONE; $Models = Model::GetModels(new ModelSearchParameters(is_NULL($ModelID) ? FALSE : $ModelID)); $Sets = Set::GetSets(new SetSearchParameters(FALSE, FALSE, is_null($ModelID) ? FALSE : $ModelID)); $outfile = 'CandyDollDB.csv'; if ($ModelID && count($Models) > 0) { $Model = $Models[0]; $outfile = sprintf('CandyDollDB %1$s.csv', $Model->GetFullName()); } header(sprintf('Content-type: %1$s', Utils::GetMime('csv'))); header(sprintf('Content-Disposition: attachment; filename="%1$s"', $outfile)); $commentarray = array(sprintf("Generated by CandyDollDB v%1\$s on %2\$s at %3\$s", CANDYDOLLDB_VERSION, date('Y-m-d'), date('H:i;s')), sprintf("Author: %1\$s", $CurrentUser->getUserName()), "Project website: https://code.google.com/p/candydolldb/"); $commentcount = count($commentarray); $x = 0; /* @var $Model Model */ foreach ($Models as $Model) { if ($ModelID && $Model->getID() !== $ModelID) { continue; }
<?php include 'cd.php'; ini_set('max_execution_time', '3600'); $CurrentUser = Authentication::Authenticate(); if (!$CurrentUser->hasPermission(RIGHT_VIDEO_ADD) && !$CurrentUser->hasPermission(RIGHT_VIDEO_EDIT)) { $e = new Error(RIGHTS_ERR_USERNOTALLOWED); Error::AddError($e); HTMLstuff::RefererRedirect(); } $ModelID = Utils::SafeIntFromQS('model_id'); $SetID = Utils::SafeIntFromQS('set_id'); $Models = Model::GetModels(new ModelSearchParameters(is_null($ModelID) ? FALSE : $ModelID)); $Sets = Set::GetSets(new SetSearchParameters(is_null($SetID) ? FALSE : $SetID)); $Videos = Video::GetVideos(new VideoSearchParameters(FALSE, FALSE, is_null($SetID) ? FALSE : $SetID, FALSE, is_null($ModelID) ? FALSE : $ModelID)); $CacheImages = CacheImage::GetCacheImages(); if ($SetID) { $Set = $Sets[0]; $Models = array($Set->getModel()); } /* @var $Model Model */ for ($i = 0; $i < count($Models); $i++) { $Model = $Models[$i]; $VideoFolder = sprintf('%1$s/%2$s', CANDYPATH, $Model->GetFullName()); if (!file_exists($VideoFolder)) { continue; } /* @var $it RecursiveIteratorIterator */ $it = new RecursiveDirectoryIterator($VideoFolder, FileSystemIterator::SKIP_DOTS | FileSystemIterator::CURRENT_AS_FILEINFO); $itArray = array(); foreach ($it as $file) {
<?php include 'cd.php'; $CurrentUser = Authentication::Authenticate(); HTMLstuff::RefererRegister($_SERVER['REQUEST_URI']); $ModelID = Utils::SafeIntFromQS('model_id'); if (!isset($ModelID)) { header('location:index.php'); exit; } $Model = NULL; $SetRows = ''; $SetCount = 0; $Video = NULL; $Videos = Video::GetVideos(new VideoSearchParameters(FALSE, FALSE, FALSE, FALSE, $ModelID)); $Sets = Set::GetSets(new SetSearchParameters(FALSE, FALSE, $ModelID)); $Dates = Date::GetDates(new DateSearchParameters(FALSE, FALSE, FALSE, FALSE, $ModelID)); if ($Sets) { if ($Sets[0]->getModel()->getFirstName() == 'VIP') { usort($Sets, array('Set', 'CompareAsc')); } /* @var $Set Set */ foreach ($Sets as $Set) { $SetCount++; if (!$Model) { $Model = $Set->getModel(); } $DatesThisSet = Date::FilterDates($Dates, NULL, $ModelID, $Set->getID()); $Video = Video::Filter($Videos, $ModelID, $Set->getID()); if ($Video) { $Video = $Video[0];
<?php include 'cd.php'; $CurrentUser = Authentication::Authenticate(); if (!$CurrentUser->hasPermission(RIGHT_CACHE_DELETE)) { $e = new Error(RIGHTS_ERR_USERNOTALLOWED); Error::AddError($e); HTMLstuff::RefererRedirect(); } $ImageID = Utils::SafeIntFromQS('image_id'); $VideoID = Utils::SafeIntFromQS('video_id'); $SetID = Utils::SafeIntFromQS('set_id'); $ModelIndexID = Utils::SafeIntFromQS('index_id'); $ModelID = Utils::SafeIntFromQS('model_id'); $Width = Utils::SafeIntFromQS('width'); $Height = Utils::SafeIntFromQS('height'); $DeleteSetsImages = Utils::SafeBoolFromQS('deleteimages'); $DeleteSetsVideos = Utils::SafeBoolFromQS('deletevideos'); $CacheImages = array(); $MultipleImageIDs = NULL; $MultipleVideoIDs = NULL; if (!is_null($SetID) && $DeleteSetsImages) { $imagesThisSet = Image::GetImages(new ImageSearchParameters(FALSE, FALSE, $SetID)); /* @var $im Image */ foreach ($imagesThisSet as $im) { $MultipleImageIDs[] = $im->getID(); } $cisp = new CacheImageSearchParameters(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, is_null($MultipleImageIDs) ? FALSE : $MultipleImageIDs); if ($cisp->getValues()) { $CacheImages = array_merge($CacheImages, CacheImage::GetCacheImages($cisp)); }
<?php include 'cd.php'; $CurrentUser = Authentication::Authenticate(); HTMLstuff::RefererRegister($_SERVER['REQUEST_URI']); $TagID = Utils::SafeIntFromQS('tag_id'); $DeleteTag = array_key_exists('hidTagToDelete', $_POST) && $TagID && $_POST['hidTagToDelete'] == $TagID; $Tags = Tag::GetTags(); $Tag = Tag::Filter($Tags, $TagID); $Tag = $TagID && $Tag ? $Tag[0] : new Tag(); $Tagcount = 0; $TagList = NULL; $DisableControls = $DeleteTag || !$CurrentUser->hasPermission(RIGHT_TAG_EDIT) && !is_null($TagID) || !$CurrentUser->hasPermission(RIGHT_TAG_ADD) && is_null($TagID); $DisableDefaultButton = !$CurrentUser->hasPermission(RIGHT_TAG_DELETE) && !is_null($TagID) && $DeleteTag || !$CurrentUser->hasPermission(RIGHT_TAG_EDIT) && !is_null($TagID) && !$DeleteTag || !$CurrentUser->hasPermission(RIGHT_TAG_ADD) && is_null($TagID); if (array_key_exists('hidAction', $_POST) && $_POST['hidAction'] == 'TagView') { $Tag->setName(Utils::NullIfEmpty($_POST['txtName'])); if ($Tag->getID()) { if ($DeleteTag) { if ($CurrentUser->hasPermission(RIGHT_TAG_DELETE) && Tag::Delete($Tag, $CurrentUser)) { $t2as = Tag2All::GetTag2Alls(new Tag2AllSearchParameters($Tag->getID())); Tag2All::DeleteMulti($t2as, $CurrentUser); header('location:' . $_SERVER['PHP_SELF']); exit; } } else { if ($CurrentUser->hasPermission(RIGHT_TAG_EDIT) && Tag::Update($Tag, $CurrentUser)) { header('location:' . $_SERVER['PHP_SELF']); exit; } } } else {
<?php include 'cd.php'; ini_set('max_execution_time', '3600'); $CurrentUser = Authentication::Authenticate(); $ImageID = Utils::SafeIntFromQS('image_id'); $VideoID = Utils::SafeIntFromQS('video_id'); $SetID = Utils::SafeIntFromQS('set_id'); $ModelIndexID = Utils::SafeIntFromQS('index_id'); $ModelID = Utils::SafeIntFromQS('model_id'); $Width = Utils::SafeIntFromQS('width'); $Height = Utils::SafeIntFromQS('height'); $ThumbsPerPage = Utils::SafeIntFromQS('perpage'); $PromptDownload = Utils::SafeBoolFromQS('download'); $PortraitOnly = Utils::SafeBoolFromQS('portrait_only'); $LandscapeOnly = Utils::SafeBoolFromQS('landscape_only'); $IndexOutputMode = EXPORT_OPTION_IMAGE; if (array_key_exists('output', $_GET) && in_array($_GET['output'], array(EXPORT_OPTION_SERIALIZE, EXPORT_OPTION_IMAGE, EXPORT_OPTION_ZIP))) { $IndexOutputMode = intval($_GET['output']); } $CacheImage = NULL; /* @var $CacheImage CacheImage */ /* @var $Video Video */ /* @var $Image Image */ /* @var $Set Set */ /* @var $Model Model */ if ($ModelIndexID) { $CacheImage = CacheImage::GetCacheImages(new CacheImageSearchParameters(FALSE, FALSE, $ModelIndexID, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, $Width, $Height, FALSE, is_null($ThumbsPerPage) ? FALSE : $ThumbsPerPage)); if ($CacheImage && count($CacheImage) == 1) { $CacheImage = $CacheImage[0]; $Model = Model::GetModels(new ModelSearchParameters($ModelIndexID));
<?php include 'cd.php'; $CurrentUser = Authentication::Authenticate(); HTMLstuff::RefererRegister($_SERVER['REQUEST_URI']); $ModelID = Utils::SafeIntFromQS('model_id'); $SetID = Utils::SafeIntFromQS('set_id'); $ImageID = Utils::SafeIntFromQS('image_id'); $TagsInDB = Tag::GetTags(); $TagsThisImage = Tag2All::GetTag2Alls(new Tag2AllSearchParameters(FALSE, FALSE, FALSE, is_null($ModelID) ? FALSE : $ModelID, FALSE, is_null($SetID) ? FALSE : $SetID, FALSE, is_null($ImageID) ? FALSE : $ImageID, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE)); if (!isset($ModelID)) { header('location:index.php'); exit; } if (!isset($SetID)) { header('location:set.php?model_id=' . $ModelID); exit; } $DeleteImage = array_key_exists('cmd', $_GET) && $_GET['cmd'] && $_GET['cmd'] == COMMAND_DELETE; $ReturnURL = sprintf('image.php?model_id=%1$d&set_id=%2$d', $ModelID, $SetID); $DisableControls = $DeleteImage || !$CurrentUser->hasPermission(RIGHT_IMAGE_EDIT) && !is_null($ImageID) || !$CurrentUser->hasPermission(RIGHT_IMAGE_ADD) && is_null($ImageID); $DisableDefaultButton = !$CurrentUser->hasPermission(RIGHT_IMAGE_DELETE) && !is_null($ImageID) && $DeleteImage || !$CurrentUser->hasPermission(RIGHT_IMAGE_EDIT) && !is_null($ImageID) && !$DeleteImage || !$CurrentUser->hasPermission(RIGHT_IMAGE_ADD) && is_null($ImageID); $DisableCacheDeleteButton = $DeleteImage || is_null($ImageID) || !$CurrentUser->hasPermission(RIGHT_CACHE_DELETE); /* @var $Image Image */ /* @var $Set Set */ /* @var $Model Model */ if ($ImageID != NULL) { $Images = Image::GetImages(new ImageSearchParameters($ImageID, FALSE, is_null($SetID) ? FALSE : $SetID, FALSE, is_null($ModelID) ? FALSE : $ModelID)); if ($Images) { $Image = $Images[0]; } else {
<?php include 'cd.php'; $CurrentUser = Authentication::Authenticate(); HTMLstuff::RefererRegister($_SERVER['REQUEST_URI']); $ModelID = Utils::SafeIntFromQS('model_id'); $SetID = Utils::SafeIntFromQS('set_id'); $VideoID = Utils::SafeIntFromQS('video_id'); $TagsInDB = Tag::GetTags(); $TagsThisVideo = Tag2All::GetTag2Alls(new Tag2AllSearchParameters(FALSE, FALSE, FALSE, $ModelID, FALSE, $SetID, FALSE, FALSE, FALSE, $VideoID, FALSE, FALSE, FALSE, TRUE, FALSE)); if (!isset($ModelID)) { header('location:index.php'); exit; } if (!isset($SetID)) { header('location:set.php?model_id=' . $ModelID); exit; } $DeleteVideo = array_key_exists('cmd', $_GET) && $_GET['cmd'] && $_GET['cmd'] == COMMAND_DELETE; $ReturnURL = sprintf('video.php?model_id=%1$d&set_id=%2$d', $ModelID, $SetID); $DisableControls = $DeleteVideo || !$CurrentUser->hasPermission(RIGHT_VIDEO_EDIT) && !is_null($VideoID) || !$CurrentUser->hasPermission(RIGHT_VIDEO_ADD) && is_null($VideoID); $DisableDefaultButton = !$CurrentUser->hasPermission(RIGHT_VIDEO_DELETE) && !is_null($VideoID) && $DeleteVideo || !$CurrentUser->hasPermission(RIGHT_VIDEO_EDIT) && !is_null($VideoID) && !$DeleteVideo || !$CurrentUser->hasPermission(RIGHT_VIDEO_ADD) && is_null($VideoID); $DisableCacheDeleteButton = $DeleteVideo || is_null($VideoID) || !$CurrentUser->hasPermission(RIGHT_CACHE_DELETE); /* @var $Video Video */ /* @var $Set Set */ /* @var $Model Model */ if ($VideoID != NULL) { $Videos = Video::GetVideos(new VideoSearchParameters($VideoID, FALSE, $SetID, FALSE, $ModelID)); if ($Videos) { $Video = $Videos[0]; } else {
$Total = NULL; $searchMode = NULL; $q = NULL; $page = 1; $max_results = 30; $ToShow = array(); $Tag2Alls = array(); $ItemCount = 0; $Results = ''; /* Querystring and session-processing */ if (isset($_GET['p'])) { $page = Utils::SafeIntFromQS('p'); $page = $page <= 0 ? 1 : $page; } if (isset($_GET['x'])) { $max_results = Utils::SafeIntFromQS('x'); $max_results <= 0 ? 30 : $max_results; } $from = $page * $max_results - $max_results; $q = array_key_exists('q', $_GET) ? $_GET['q'] : (array_key_exists('q', $_SESSION) ? $_SESSION['q'] : ''); $_SESSION['q'] = $q; $searchMode = array_key_exists('t', $_GET) ? $_GET['t'] : (array_key_exists('t', $_SESSION) ? $_SESSION['t'] : 'SET'); $_SESSION['t'] = $searchMode; /* Core search-processing */ $filteredTags = Tag::FilterByCSV($Tags, $q); $filteredTagIDs = array(); foreach ($filteredTags as $t) { $filteredTagIDs[] = $t->getID(); } /* Fetch Tag2Alls if tags were entered, default to no results when $q is empty. */ $Tag2Alls = $filteredTagIDs ? Tag2All::GetTag2Alls(new Tag2AllSearchParameters(FALSE, $filteredTagIDs)) : array();
<?php include 'cd.php'; $CurrentUser = Authentication::Authenticate(); if ($CurrentUser->hasPermission(RIGHT_SET_ADD) || $CurrentUser->hasPermission(RIGHT_SET_EDIT)) { $DateID = Utils::SafeIntFromQS('date_id'); if (isset($DateID)) { Date::Delete(new Date($DateID), $CurrentUser); } } else { $e = new Error(RIGHTS_ERR_USERNOTALLOWED); Error::AddError($e); } HTMLstuff::RefererRedirect();
<?php include 'cd.php'; $CurrentUser = Authentication::Authenticate(); HTMLstuff::RefererRegister($_SERVER['REQUEST_URI']); $UserID = Utils::SafeIntFromQS('user_id'); $DeleteUser = array_key_exists('cmd', $_GET) && $_GET['cmd'] && $_GET['cmd'] == COMMAND_DELETE; $_SESSION['UserSalt'] = NULL; $PasswordError = FALSE; $LanguageOptions = NULL; $DateFormatOptions = NULL; $RightsCheckboxes = NULL; $DisableControls = $DeleteUser || $UserID == $CurrentUser->getID() && !$CurrentUser->hasPermission(RIGHT_ACCOUNT_EDIT) || $UserID != $CurrentUser->getID() && !$CurrentUser->hasPermission(RIGHT_USER_EDIT) && !is_null($UserID) || $UserID != $CurrentUser->getID() && !$CurrentUser->hasPermission(RIGHT_USER_ADD) && is_null($UserID); $DisableDefaultButton = $UserID == $CurrentUser->getID() && !$CurrentUser->hasPermission(RIGHT_ACCOUNT_EDIT) || $UserID != $CurrentUser->getID() && !$CurrentUser->hasPermission(RIGHT_USER_DELETE) && !is_null($UserID) && $DeleteUser || $UserID != $CurrentUser->getID() && !$CurrentUser->hasPermission(RIGHT_USER_EDIT) && !is_null($UserID) && !$DeleteUser || $UserID != $CurrentUser->getID() && !$CurrentUser->hasPermission(RIGHT_USER_ADD) && is_null($UserID); $DisableRights = $DeleteUser || !$CurrentUser->hasPermission(RIGHT_USER_RIGHTS) && !is_null($UserID); /* @var $User User */ if ($UserID) { $Users = User::GetUsers(new UserSearchParameters($UserID)); if ($Users) { $User = $Users[0]; } else { header('location:index.php'); exit; } $_SESSION['UserSalt'] = $User->getSalt(); } else { $User = new User(NULL, $lang->g('LabelNewUser')); } if (array_key_exists('hidAction', $_POST) && $_POST['hidAction'] == 'UserView') { if (array_key_exists('txtUserName', $_POST)) { $User->setUserName(Utils::NullIfEmpty($_POST['txtUserName']));