diff --git a/objects/category.php b/objects/category.php index 44faf8aec5..6c9f82c2b7 100644 --- a/objects/category.php +++ b/objects/category.php @@ -386,7 +386,11 @@ class Category } if ($onlyWithVideos) { - $sql .= " AND ((SELECT count(*) FROM videos v where v.categories_id = c.id OR categories_id IN (SELECT id from categories where parentId = c.id AND id != c.id)) > 0 "; + $sql .= " AND ((SELECT count(*) FROM videos v where 1=1 "; + if(isForKidsSet()){ + $sql .= " AND v.made_for_kids = 1 "; + } + $sql .= " AND v.categories_id = c.id OR categories_id IN (SELECT id from categories where parentId = c.id AND id != c.id)) > 0 "; if (AVideoPlugin::isEnabledByName("Live")) { $sql .= " OR " . " (" @@ -404,6 +408,7 @@ class Category } $sql .= ")"; } + if ($sameUserGroupAsMe) { //_error_log('getAllCategories getUserGroups'); $users_groups = UserGroups::getUserGroups($sameUserGroupAsMe); @@ -941,7 +946,11 @@ class Category $sql .= "AND parentId = 0 OR parentId = -1 "; } if ($onlyWithVideos) { - $sql .= " AND ((SELECT count(*) FROM videos v where v.categories_id = c.id OR categories_id IN (SELECT id from categories where parentId = c.id AND id != c.id)) > 0 "; + $sql .= " AND ((SELECT count(*) FROM videos v where 1=1 "; + if(isForKidsSet()){ + $sql .= " AND v.made_for_kids = 1 "; + } + $sql .= " AND v.categories_id = c.id OR categories_id IN (SELECT id from categories where parentId = c.id AND id != c.id) ) > 0 "; if (AVideoPlugin::isEnabledByName("Live")) { $sql .= " OR " . " (" diff --git a/objects/login.json.php b/objects/login.json.php index 5c90d14c1d..3b81ec100c 100644 --- a/objects/login.json.php +++ b/objects/login.json.php @@ -213,6 +213,12 @@ if ($resp === User::USER_NOT_VERIFIED) { die(json_encode($object)); } +if ($resp === User::SYSTEM_ERROR) { + _error_log("login.json.php System error", AVideoLog::$ERROR); + $object->error = __("System error, check your logs"); + die(json_encode($object)); +} + if ($resp === User::CAPTCHA_ERROR) { _error_log("login.json.php invalid captcha"); $object->error = __("Invalid Captcha"); diff --git a/objects/mysql_dal.php b/objects/mysql_dal.php index 68e838a494..c6de5bd509 100644 --- a/objects/mysql_dal.php +++ b/objects/mysql_dal.php @@ -105,7 +105,7 @@ class sqlDAL // make sure it does not store autid transactions if(strpos($preparedStatement, 'CachesInDB')===false){ $debug = debug_backtrace(); - if (empty($debug[2]['class']) || $debug[2]['class'] !== "AuditTable") { + if (empty($debug[2]['class']) || $debug[2]['class'] !== "AuditTable" && class_exists('AVideoPlugin')) { $audit = AVideoPlugin::loadPluginIfEnabled('Audit'); if (!empty($audit)) { try { diff --git a/objects/playlist.php b/objects/playlist.php index a1f6129c02..ce01113afd 100644 --- a/objects/playlist.php +++ b/objects/playlist.php @@ -325,6 +325,10 @@ class PlayList extends ObjectYPT $sql .= " LEFT JOIN videos v ON pl.id = serie_playlists_id "; } $sql .= " LEFT JOIN users u ON u.id = pl.users_id WHERE 1=1 "; + + if($includeSeries && isForKidsSet()){ + $sql .= " AND v.made_for_kids = 1 "; + } if (!empty($playlists_id)) { $sql .= " AND pl.id = '{$playlists_id}' "; } diff --git a/objects/user.php b/objects/user.php index 6b9ec8911a..cb7b626034 100644 --- a/objects/user.php +++ b/objects/user.php @@ -131,9 +131,9 @@ class User function setBirth_date($birth_date): void { - if(_empty($birth_date)){ + if (_empty($birth_date)) { $this->birth_date = 'NULL'; - }else{ + } else { $time = strtotime($birth_date); $this->birth_date = date('Y/m/d', $time); } @@ -817,7 +817,7 @@ if (typeof gtag !== \"function\") { } if (!_empty($this->birth_date)) { $values[] = $this->birth_date; - }else{ + } else { $values[] = null; } $formats .= "s"; @@ -1125,9 +1125,14 @@ if (typeof gtag !== \"function\") { public const USER_NOT_FOUND = 2; public const CAPTCHA_ERROR = 3; public const REQUIRE2FA = 4; + public const SYSTEM_ERROR = 5; public function login($noPass = false, $encodedPass = false, $ignoreEmailVerification = false) { + if (!class_exists('AVideoPlugin')) { + _error_log("ERROR login($noPass, $encodedPass, $ignoreEmailVerification) " . json_encode(debug_backtrace())); + return self::SYSTEM_ERROR; + } if (User::isLogged()) { //_error_log('User:login is already logged '.json_encode($_SESSION['user']['id'])); return self::USER_LOGGED; @@ -1371,12 +1376,12 @@ if (typeof gtag !== \"function\") { $user = new User($users_id); $birth_date = $user->getBirth_date(); } else { - if(empty($_SESSION['user']['birth_date'])){ + if (empty($_SESSION['user']['birth_date'])) { self::recreateLoginFromCookie(); } - if(!empty($_SESSION['user']['birth_date'])){ + if (!empty($_SESSION['user']['birth_date'])) { $birth_date = $_SESSION['user']['birth_date']; - }else{ + } else { $user = new User(User::getId()); $birth_date = $_SESSION['user']['birth_date'] = $user->getBirth_date(); } @@ -1393,7 +1398,7 @@ if (typeof gtag !== \"function\") { $birth_date = new DateTime($birth_date); $current_date = new DateTime('now'); $age = $current_date->diff($birth_date)->y; - if($age<0){ + if ($age < 0) { return 0; } return $age; @@ -3028,6 +3033,9 @@ if (typeof gtag !== \"function\") { case self::REQUIRE2FA: _error_log("loginFromRequest REQUIRE2FA {$_REQUEST['user']}"); break; + case self::SYSTEM_ERROR: + _error_log("loginFromRequest SYSTEM_ERROR {$_REQUEST['user']}"); + break; default: _error_log("loginFromRequest UNDEFINED {$_REQUEST['user']}"); break; diff --git a/objects/video.php b/objects/video.php index 0a14ab1acd..9c6925900d 100644 --- a/objects/video.php +++ b/objects/video.php @@ -1472,7 +1472,7 @@ if (!class_exists('Video')) { $sql .= " UNION "; - $sql .= "SELECT * FROM videos v WHERE v.id != {$videos_id} AND v.status='a' "; + $sql .= "SELECT * FROM videos v WHERE v.id != {$videos_id} AND v.status='".Video::$statusActive."' "; if(isForKidsSet()){ $sql .= " AND made_for_kids = 1 "; diff --git a/plugin/CDN/Storage/CDNStorage.php b/plugin/CDN/Storage/CDNStorage.php index 02831684f7..ddb960bcd3 100644 --- a/plugin/CDN/Storage/CDNStorage.php +++ b/plugin/CDN/Storage/CDNStorage.php @@ -1052,7 +1052,7 @@ class CDNStorage $totalTime = time() - $modified; if ($totalTime > 300) { if ($totalTime > 10000) { - unlink($file); + @unlink($file); return false; } else { // if is laonger than 5 min say it is not moving @@ -1071,7 +1071,7 @@ class CDNStorage $extension = strtolower($path_parts['extension']); if ($extension == 'ts') { - unlink($file_path); + @unlink($file_path); } elseif (in_array($extension, CDNStorage::$allowedFiles)) { file_put_contents($file_path, 'Dummy File'); } else { @@ -1301,7 +1301,7 @@ class CDNStorage if (empty($file_exists)) { $file_exists = CDNStorage::file_exists_on_cdn($relativeFilename); if (!$file_exists && isDummyFile($localFile)) { - unlink($localFile); + @unlink($localFile); } else if ($file_exists && !isDummyFile($localFile)) { self::createDummy($localFile); } @@ -1318,7 +1318,7 @@ class CDNStorage } else { $filesize = filesize($localFile); if (empty($filesize) || isDummyFile($localFile)) { - unlink($localFile); + @unlink($localFile); } else if (!isDummyFile($localFile)) { _error_log('convertCDNHLSVideoToDownlaod: Upload file to CDN ' . $localFile); $client = CDNStorage::getStorageClient(); diff --git a/plugin/Gallery/view/modeGalleryCategory.php b/plugin/Gallery/view/modeGalleryCategory.php index 261d08ba25..e40a283aa4 100644 --- a/plugin/Gallery/view/modeGalleryCategory.php +++ b/plugin/Gallery/view/modeGalleryCategory.php @@ -17,6 +17,9 @@ if(empty($_GET['tagsid']) && !empty($_REQUEST['tags_id'])){ $onlySuggested = $obj->CategoriesShowOnlySuggested; if(!empty(getSearchVar())){ $onlySuggested = false; + echo ''; +}else{ + echo ''; } $sort = @$_POST['sort']; unset($_POST['sort']); @@ -34,7 +37,6 @@ if (empty($categories)) { unsetCurrentPage(); $_REQUEST['rowCount'] = $obj->CategoriesRowCount; ?> -
.row-label { display: flex; - /* Enables Flexbox */ align-items: center; - /* Centers items vertically */ + justify-content: space-between; } .colorful-text { diff --git a/view/include/navbarMenuAndLogo.php b/view/include/navbarMenuAndLogo.php index bed8d3e736..a51e6efa39 100644 --- a/view/include/navbarMenuAndLogo.php +++ b/view/include/navbarMenuAndLogo.php @@ -40,15 +40,6 @@ -
  • - -
  • - \ No newline at end of file diff --git a/view/include/navbarSidebar.php b/view/include/navbarSidebar.php index 0d38b6f6f1..4bfb72114f 100644 --- a/view/include/navbarSidebar.php +++ b/view/include/navbarSidebar.php @@ -9,18 +9,15 @@ global $avideoLayout; if (empty($advancedCustom->doNotShowLeftHomeButton)) { ?>
  • -
    -
  • @@ -66,6 +63,20 @@ global $avideoLayout;
  • +
  • +
    +
  • +
  • +
    + +
    +
  • + doNotShowLeftProfile)) { if (User::isLogged()) { ?> @@ -256,7 +267,7 @@ global $avideoLayout; + ?>