feat: Add comprehensive documentation suite and reorganize project structure
- Created complete documentation in docs/ directory - Added PROJECT_OVERVIEW.md with feature highlights and getting started guide - Added ARCHITECTURE.md with system design and technical details - Added SECURITY.md with comprehensive security implementation guide - Added DEVELOPMENT.md with development workflows and best practices - Added DEPLOYMENT.md with production deployment instructions - Added API.md with complete REST API documentation - Added CONTRIBUTING.md with contribution guidelines - Added CHANGELOG.md with version history and migration notes - Reorganized all documentation files into docs/ directory for better organization - Updated README.md with proper documentation links and quick navigation - Enhanced project structure with professional documentation standards
This commit is contained in:
34
f_modules/m_frontend/m_auth/auth.php
Normal file
34
f_modules/m_frontend/m_auth/auth.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
defined('_ISVALID') or exit;
|
||||
|
||||
class VAuth {
|
||||
public static function loginForm() {
|
||||
global $smarty;
|
||||
return $smarty->fetch('tpl_login.tpl');
|
||||
}
|
||||
|
||||
public static function registerForm() {
|
||||
global $smarty;
|
||||
return $smarty->fetch('tpl_register.tpl');
|
||||
}
|
||||
|
||||
public static function processLogin() {
|
||||
$username = VSecurity::postParam('username', 'string');
|
||||
$password = VSecurity::postParam('password', 'string');
|
||||
|
||||
if ($username && $password) {
|
||||
// Basic authentication logic
|
||||
global $class_database;
|
||||
$sql = "SELECT * FROM db_accountuser WHERE usr_user = ? AND usr_password = ?";
|
||||
$user = $class_database->execute($sql, [$username, md5($password)]);
|
||||
|
||||
if ($user && count($user) > 0) {
|
||||
VSession::setUserSession($user[0]);
|
||||
return ['success' => 'Login successful'];
|
||||
}
|
||||
}
|
||||
|
||||
return ['error' => 'Invalid credentials'];
|
||||
}
|
||||
}
|
||||
?>
|
||||
35
f_modules/m_frontend/m_auth/captcha.php
Normal file
35
f_modules/m_frontend/m_auth/captcha.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*******************************************************************************************************************
|
||||
| Software Name : EasyStream
|
||||
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
|
||||
| Software Author : (c) Sami Ahmed
|
||||
|*******************************************************************************************************************
|
||||
|
|
||||
|*******************************************************************************************************************
|
||||
| This source file is subject to the EasyStream Proprietary License Agreement.
|
||||
|
|
||||
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|
||||
|*******************************************************************************************************************
|
||||
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|
||||
|*******************************************************************************************************************/
|
||||
|
||||
define('_ISVALID', true);
|
||||
|
||||
include_once 'f_core/config.core.php';
|
||||
|
||||
$cfg = $class_database->getConfigurations('email_change_captcha_level,signup_captcha_level,frontend_username_recovery_captcha_level,frontend_password_recovery_captcha_level,backend_username_recovery_captcha_level,backend_password_recovery_captcha_level');
|
||||
|
||||
switch ($_GET["extra"]) {
|
||||
case '':$_c = new VCaptcha('', $cfg["signup_captcha_level"]);
|
||||
break;
|
||||
case '1':$_c = new VCaptcha('recover_left', $cfg["frontend_password_recovery_captcha_level"]);
|
||||
break;
|
||||
case '2':$_c = new VCaptcha('recover_right', $cfg["frontend_username_recovery_captcha_level"]);
|
||||
break;
|
||||
case '3':$_c = new VCaptcha('recover_left', $cfg["backend_password_recovery_captcha_level"]);
|
||||
break;
|
||||
case '4':$_c = new VCaptcha('recover_right', $cfg["backend_username_recovery_captcha_level"]);
|
||||
break;
|
||||
case '5':$_c = new VCaptcha('change_email', $cfg["email_change_captcha_level"]);
|
||||
break;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"critical","message":"Uncaught Exception: Non-static method VLogin::isLoggedIn() cannot be called statically in /srv/easystream/f_modules/m_frontend/m_auth/signin.php on line 81","context":{"exception_class":"Error","file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":81,"trace":"#0 {main}","previous":null},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.logger.php","line":395,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":117,"function":"critical","class":"VLogger"},{"file":"unknown","line":0,"function":"handleException","class":"VErrorHandler"}]}
|
||||
@@ -0,0 +1,26 @@
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined array key \"session_lifetime\" in /srv/easystream/f_core/f_classes/class.session.php on line 26","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_core/f_classes/class.session.php","line":26,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_core/f_classes/class.session.php","line":26,"function":"handleError","class":"VErrorHandler"},{"file":"/srv/easystream/f_core/config.core.php","line":61,"function":"init","class":"VSession"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":21,"function":"include_once","class":null}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined array key \"session_name\" in /srv/easystream/f_core/f_classes/class.session.php on line 40","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_core/f_classes/class.session.php","line":40,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_core/f_classes/class.session.php","line":40,"function":"handleError","class":"VErrorHandler"},{"file":"/srv/easystream/f_core/config.core.php","line":61,"function":"init","class":"VSession"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":21,"function":"include_once","class":null}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: ini_set(): session.name "" cannot be numeric or empty in /srv/easystream/f_core/f_classes/class.session.php on line 40","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_core/f_classes/class.session.php","line":40,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"unknown","line":0,"function":"handleError","class":"VErrorHandler"},{"file":"/srv/easystream/f_core/f_classes/class.session.php","line":40,"function":"ini_set","class":null},{"file":"/srv/easystream/f_core/config.core.php","line":61,"function":"init","class":"VSession"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":21,"function":"include_once","class":null}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined array key \"session_lifetime\" in /srv/easystream/f_core/f_classes/class.session.php on line 63","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_core/f_classes/class.session.php","line":63,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_core/f_classes/class.session.php","line":63,"function":"handleError","class":"VErrorHandler"},{"file":"/srv/easystream/f_core/f_classes/class.session.php","line":50,"function":"_sessionInit","class":"VSession"},{"file":"/srv/easystream/f_core/config.core.php","line":61,"function":"init","class":"VSession"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":21,"function":"include_once","class":null}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined array key \"fe_lang\" in /srv/easystream/f_core/f_classes/class.session.php on line 83","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_core/f_classes/class.session.php","line":83,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_core/f_classes/class.session.php","line":83,"function":"handleError","class":"VErrorHandler"},{"file":"/srv/easystream/f_core/f_classes/class.session.php","line":50,"function":"_sessionInit","class":"VSession"},{"file":"/srv/easystream/f_core/config.core.php","line":61,"function":"init","class":"VSession"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":21,"function":"include_once","class":null}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined variable $backend_access_url in /srv/easystream/f_core/config.core.php on line 68","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_core/config.core.php","line":68,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_core/config.core.php","line":68,"function":"handleError","class":"VErrorHandler"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":21,"function":"include_once","class":null}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined property: VFilter::$_allowDOMEvents in /srv/easystream/f_core/f_classes/class.filter.php on line 212","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_core/f_classes/class.filter.php","line":212,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_core/f_classes/class.filter.php","line":212,"function":"handleError","class":"VErrorHandler"},{"file":"/srv/easystream/f_core/f_classes/class.filter.php","line":318,"function":"removeEvilAttributes","class":"VFilter"},{"file":"/srv/easystream/f_core/f_classes/class.filter.php","line":332,"function":"sanitize","class":"VFilter"},{"file":"/srv/easystream/f_core/f_classes/class.ipaccess.php","line":141,"function":"clr_str","class":"VFilter"},{"file":"/srv/easystream/f_core/f_classes/class.ipaccess.php","line":56,"function":"getUserIP","class":"VIPaccess"},{"file":"/srv/easystream/f_core/config.core.php","line":68,"function":"sectionAccess","class":"VIPaccess"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":21,"function":"include_once","class":null}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined property: VFilter::$_allowDOMEvents in /srv/easystream/f_core/f_classes/class.filter.php on line 212","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_core/f_classes/class.filter.php","line":212,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_core/f_classes/class.filter.php","line":212,"function":"handleError","class":"VErrorHandler"},{"file":"/srv/easystream/f_core/f_classes/class.filter.php","line":318,"function":"removeEvilAttributes","class":"VFilter"},{"file":"/srv/easystream/f_core/f_classes/class.filter.php","line":332,"function":"sanitize","class":"VFilter"},{"file":"/srv/easystream/f_core/f_classes/class.ipaccess.php","line":56,"function":"clr_str","class":"VFilter"},{"file":"/srv/easystream/f_core/config.core.php","line":68,"function":"sectionAccess","class":"VIPaccess"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":21,"function":"include_once","class":null}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Trying to access array offset on value of type bool in /srv/easystream/f_core/f_classes/class.ipaccess.php on line 27","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_core/f_classes/class.ipaccess.php","line":27,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_core/f_classes/class.ipaccess.php","line":27,"function":"handleError","class":"VErrorHandler"},{"file":"/srv/easystream/f_core/f_classes/class.ipaccess.php","line":58,"function":"banIPrange_db","class":"VIPaccess"},{"file":"/srv/easystream/f_core/config.core.php","line":68,"function":"sectionAccess","class":"VIPaccess"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":21,"function":"include_once","class":null}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined array key \"website_ip_based_access\" in /srv/easystream/f_core/f_classes/class.ipaccess.php on line 69","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_core/f_classes/class.ipaccess.php","line":69,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_core/f_classes/class.ipaccess.php","line":69,"function":"handleError","class":"VErrorHandler"},{"file":"/srv/easystream/f_core/config.core.php","line":68,"function":"sectionAccess","class":"VIPaccess"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":21,"function":"include_once","class":null}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined array key \"backend_ip_based_access\" in /srv/easystream/f_core/f_classes/class.ipaccess.php on line 70","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_core/f_classes/class.ipaccess.php","line":70,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_core/f_classes/class.ipaccess.php","line":70,"function":"handleError","class":"VErrorHandler"},{"file":"/srv/easystream/f_core/config.core.php","line":68,"function":"sectionAccess","class":"VIPaccess"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":21,"function":"include_once","class":null}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined array key \"USER_ID\" in /srv/easystream/f_core/f_classes/class.session.php on line 139","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_core/f_classes/class.session.php","line":139,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_core/f_classes/class.session.php","line":139,"function":"handleError","class":"VErrorHandler"},{"file":"/srv/easystream/f_core/config.core.php","line":71,"function":"isLoggedIn","class":"VSession"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":21,"function":"include_once","class":null}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined array key \"website_shortname\" in /srv/easystream/f_data/data_languages/en_US/lang_frontend/language.global.php on line 199","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_data/data_languages/en_US/lang_frontend/language.global.php","line":199,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_data/data_languages/en_US/lang_frontend/language.global.php","line":199,"function":"handleError","class":"VErrorHandler"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":24,"function":"include_once","class":null}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined array key \"website_shortname\" in /srv/easystream/f_data/data_languages/en_US/lang_frontend/language.global.php on line 204","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_data/data_languages/en_US/lang_frontend/language.global.php","line":204,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_data/data_languages/en_US/lang_frontend/language.global.php","line":204,"function":"handleError","class":"VErrorHandler"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":24,"function":"include_once","class":null}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined array key \"website_shortname\" in /srv/easystream/f_data/data_languages/en_US/lang_frontend/language.global.php on line 205","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_data/data_languages/en_US/lang_frontend/language.global.php","line":205,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_data/data_languages/en_US/lang_frontend/language.global.php","line":205,"function":"handleError","class":"VErrorHandler"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":24,"function":"include_once","class":null}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined array key \"custom_tagline\" in /srv/easystream/f_data/data_languages/en_US/lang_frontend/language.global.php on line 383","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_data/data_languages/en_US/lang_frontend/language.global.php","line":383,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_data/data_languages/en_US/lang_frontend/language.global.php","line":383,"function":"handleError","class":"VErrorHandler"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":24,"function":"include_once","class":null}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined array key \"website_shortname\" in /srv/easystream/f_data/data_languages/en_US/lang_frontend/language.global.php on line 402","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_data/data_languages/en_US/lang_frontend/language.global.php","line":402,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_data/data_languages/en_US/lang_frontend/language.global.php","line":402,"function":"handleError","class":"VErrorHandler"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":24,"function":"include_once","class":null}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined array key \"website_shortname\" in /srv/easystream/f_data/data_languages/en_US/lang_frontend/language.global.php on line 465","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_data/data_languages/en_US/lang_frontend/language.global.php","line":465,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_data/data_languages/en_US/lang_frontend/language.global.php","line":465,"function":"handleError","class":"VErrorHandler"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":24,"function":"include_once","class":null}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined array key \"website_shortname\" in /srv/easystream/f_data/data_languages/en_US/lang_frontend/language.signin.php on line 31","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_data/data_languages/en_US/lang_frontend/language.signin.php","line":31,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_data/data_languages/en_US/lang_frontend/language.signin.php","line":31,"function":"handleError","class":"VErrorHandler"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":25,"function":"include_once","class":null}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined array key \"website_shortname\" in /srv/easystream/f_data/data_languages/en_US/lang_frontend/language.signin.php on line 38","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_data/data_languages/en_US/lang_frontend/language.signin.php","line":38,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_data/data_languages/en_US/lang_frontend/language.signin.php","line":38,"function":"handleError","class":"VErrorHandler"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":25,"function":"include_once","class":null}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined array key \"website_shortname\" in /srv/easystream/f_data/data_languages/en_US/lang_frontend/language.signin.php on line 62","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_data/data_languages/en_US/lang_frontend/language.signin.php","line":62,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_data/data_languages/en_US/lang_frontend/language.signin.php","line":62,"function":"handleError","class":"VErrorHandler"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":25,"function":"include_once","class":null}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined array key \"paid_memberships\" in /srv/easystream/f_modules/m_frontend/m_auth/signin.php on line 30","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":30,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":30,"function":"handleError","class":"VErrorHandler"}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined array key \"gp_auth\" in /srv/easystream/f_modules/m_frontend/m_auth/signin.php on line 32","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":32,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":32,"function":"handleError","class":"VErrorHandler"}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined array key \"fb_auth\" in /srv/easystream/f_modules/m_frontend/m_auth/signin.php on line 56","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":56,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":56,"function":"handleError","class":"VErrorHandler"}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined array key \"frontend_global_submit\" in /srv/easystream/f_modules/m_frontend/m_auth/signin.php on line 74","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":74,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":74,"function":"handleError","class":"VErrorHandler"}]}
|
||||
{"timestamp":"2025-10-18 05:10:14","request_id":"req_68f32136711d68.26462734","ip":"172.18.0.1","user_agent":"curl/8.14.1","request_uri":"/f_modules/m_frontend/m_auth/signin.php","request_method":"GET","user_id":null,"session_id":null,"memory_usage":2097152,"peak_memory":2097152,"execution_time":0.1830599308013916,"level":"warning","message":"Warning: Undefined array key \"login_remember\" in /srv/easystream/f_modules/m_frontend/m_auth/signin.php on line 80","context":{"error_type":"Warning","severity":2,"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":80,"context":[]},"backtrace":[{"file":"/srv/easystream/f_core/f_classes/class.errorhandler.php","line":95,"function":"log","class":"VLogger"},{"file":"/srv/easystream/f_modules/m_frontend/m_auth/signin.php","line":80,"function":"handleError","class":"VErrorHandler"}]}
|
||||
164
f_modules/m_frontend/m_auth/fb_callback_login.php
Normal file
164
f_modules/m_frontend/m_auth/fb_callback_login.php
Normal file
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
/*******************************************************************************************************************
|
||||
| Software Name : EasyStream
|
||||
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
|
||||
| Software Author : (c) Sami Ahmed
|
||||
|*******************************************************************************************************************
|
||||
|
|
||||
|*******************************************************************************************************************
|
||||
| This source file is subject to the EasyStream Proprietary License Agreement.
|
||||
|
|
||||
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|
||||
|*******************************************************************************************************************
|
||||
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|
||||
|*******************************************************************************************************************/
|
||||
|
||||
define('_ISVALID', true);
|
||||
|
||||
$main_dir = realpath(dirname(__FILE__) . '/../../../');
|
||||
set_include_path($main_dir);
|
||||
|
||||
include_once 'f_core/config.core.php';
|
||||
|
||||
include_once 'f_core/f_classes/class_facebook/Facebook/autoload.php';
|
||||
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.global');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.recovery');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.signup');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.signin');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.notifications');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.email.notif');
|
||||
|
||||
$error_message = null;
|
||||
$notice_message = null;
|
||||
|
||||
$cfg = $class_database->getConfigurations('fb_auth,fb_app_id,fb_app_secret');
|
||||
|
||||
$_SESSION['FBRLH_' . 'state'] = $class_filter->clr_str($_GET['state']);
|
||||
|
||||
$fb = new Facebook\Facebook([
|
||||
'app_id' => $cfg['fb_app_id'],
|
||||
'app_secret' => $cfg['fb_app_secret'],
|
||||
'default_graph_version' => 'v2.7',
|
||||
'default_access_token' => '1061711193887319|fc3a99ba0d42b98b51ac3fa124268422',
|
||||
]);
|
||||
|
||||
$helper = $fb->getRedirectLoginHelper();
|
||||
|
||||
try {
|
||||
$u = $cfg["main_url"] . '/f_modules/m_frontend/m_auth/fb_callback_login.php';
|
||||
$accessToken = $helper->getAccessToken($u);
|
||||
} catch (Facebook\Exceptions\FacebookResponseException $e) {
|
||||
// When Graph returns an error
|
||||
echo 'Graph returned an error: ' . $e->getMessage();
|
||||
exit;
|
||||
} catch (Facebook\Exceptions\FacebookSDKException $e) {
|
||||
// When validation fails or other local issues
|
||||
echo 'Facebook SDK returned an error: ' . $e->getMessage();
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($accessToken)) {
|
||||
if ($helper->getError()) {
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
echo "Error: " . $helper->getError() . "\n";
|
||||
echo "Error Code: " . $helper->getErrorCode() . "\n";
|
||||
echo "Error Reason: " . $helper->getErrorReason() . "\n";
|
||||
echo "Error Description: " . $helper->getErrorDescription() . "\n";
|
||||
} else {
|
||||
header('HTTP/1.0 400 Bad Request');
|
||||
echo 'Bad request';
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
// Logged in
|
||||
|
||||
// The OAuth 2.0 client handler helps us manage access tokens
|
||||
$oAuth2Client = $fb->getOAuth2Client();
|
||||
// Get the access token metadata from /debug_token
|
||||
$tokenMetadata = $oAuth2Client->debugToken($accessToken);
|
||||
// Validation (these will throw FacebookSDKException's when they fail)
|
||||
$tokenMetadata->validateAppId($cfg['fb_app_id']); // Replace {app-id} with your app id
|
||||
// If you know the user ID this access token belongs to, you can validate it here
|
||||
$tokenMetadata->validateExpiration();
|
||||
|
||||
$user_id = $tokenMetadata->getUserId();
|
||||
|
||||
if (!$accessToken->isLongLived()) {
|
||||
// Exchanges a short-lived access token for a long-lived one
|
||||
try {
|
||||
$accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);
|
||||
} catch (Facebook\Exceptions\FacebookSDKException $e) {
|
||||
echo "<p>Error getting long-lived access token: " . $helper->getMessage() . "</p>\n\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$_SESSION['fb_access_token'] = (string) $accessToken;
|
||||
|
||||
try {
|
||||
// Returns a `Facebook\FacebookResponse` object
|
||||
$response = $fb->get('/me?fields=id,about,cover,email,first_name,picture.width(300).height(300),last_name,name', $accessToken);
|
||||
} catch (Facebook\Exceptions\FacebookResponseException $e) {
|
||||
echo 'Graph returned an error: ' . $e->getMessage();
|
||||
exit;
|
||||
} catch (Facebook\Exceptions\FacebookSDKException $e) {
|
||||
echo 'Facebook SDK returned an error: ' . $e->getMessage();
|
||||
exit;
|
||||
}
|
||||
|
||||
$user = $response->getGraphUser();
|
||||
|
||||
$go = true;
|
||||
|
||||
if ($user_id and $go) {
|
||||
$rs = $db->execute(sprintf("SELECT `usr_id` FROM `db_accountuser` WHERE `oauth_provider`='facebook' AND `oauth_uid`='%s' LIMIT 1;", $user_id));
|
||||
|
||||
if ($rs->fields['usr_id']) {
|
||||
$usr_id = $rs->fields['usr_id'];
|
||||
$reguser = VUserinfo::getUserInfo($usr_id);
|
||||
} else {
|
||||
if (isset($user['birthday']->date)) {
|
||||
$a = $user['birthday']->date;
|
||||
$b = explode(' ', $a);
|
||||
$birthday = $b[0];
|
||||
} else {
|
||||
$birthday = '0000-00-00';
|
||||
}
|
||||
$uu = explode('@', $user['email']);
|
||||
$_SESSION["fb_user"] = array(
|
||||
'id' => $user_id,
|
||||
'email' => $user['email'],
|
||||
'name' => $user['name'],
|
||||
'picture' => $user['picture']['url'],
|
||||
'username' => $uu[0],
|
||||
'gender' => 'M',
|
||||
'country' => (isset($user['user_location']->name) ? $user['user_location']->name : ''),
|
||||
'city' => (isset($user['user_location']->hometown) ? $user['user_location']->hometown : ''),
|
||||
'birth_date' => $birthday,
|
||||
'status' => 1,
|
||||
);
|
||||
|
||||
echo VSignup::auth_register_ajax();
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($reguser['key'] != '') {
|
||||
$_SESSION["USER_ID"] = $usr_id;
|
||||
$_SESSION["USER_NAME"] = $reguser['uname'];
|
||||
$_SESSION["USER_KEY"] = $reguser['key'];
|
||||
$_SESSION["USER_DNAME"] = $reguser['dname'];
|
||||
|
||||
$login_update = VLogin::updateOnLogin($usr_id);
|
||||
$log_activity = ($cfg["activity_logging"] == 1 and $action = new VActivity($usr_id, 0)) ? $action->addTo('log_signin') : null;
|
||||
|
||||
$loc = $cfg["main_url"] . '/' . VHref::getKey('account');
|
||||
|
||||
echo '<script type="text/javascript">opener.location="' . $loc . '"; window.close();</script>';
|
||||
} else {
|
||||
die('Account suspended!');
|
||||
}
|
||||
}
|
||||
152
f_modules/m_frontend/m_auth/fb_callback_register.php
Normal file
152
f_modules/m_frontend/m_auth/fb_callback_register.php
Normal file
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
/*******************************************************************************************************************
|
||||
| Software Name : EasyStream
|
||||
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
|
||||
| Software Author : (c) Sami Ahmed
|
||||
|*******************************************************************************************************************
|
||||
|
|
||||
|*******************************************************************************************************************
|
||||
| This source file is subject to the EasyStream Proprietary License Agreement.
|
||||
|
|
||||
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|
||||
|*******************************************************************************************************************
|
||||
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|
||||
|*******************************************************************************************************************/
|
||||
|
||||
define('_ISVALID', true);
|
||||
|
||||
$main_dir = realpath(dirname(__FILE__) . '/../../../');
|
||||
set_include_path($main_dir);
|
||||
|
||||
include_once 'f_core/config.core.php';
|
||||
|
||||
include_once 'f_core/f_classes/class_facebook/Facebook/autoload.php';
|
||||
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.global');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.recovery');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.signup');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.signin');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.notifications');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.email.notif');
|
||||
|
||||
$error_message = null;
|
||||
$notice_message = null;
|
||||
|
||||
$class_database->getConfigurations('fb_auth,fb_app_id,fb_app_secret');
|
||||
|
||||
$_SESSION['FBRLH_' . 'state'] = $class_filter->clr_str($_GET['state']);
|
||||
|
||||
$fb = new Facebook\Facebook([
|
||||
'app_id' => $cfg['fb_app_id'],
|
||||
'app_secret' => $cfg['fb_app_secret'],
|
||||
'default_graph_version' => 'v2.7',
|
||||
'default_access_token' => '1061711193887319|fc3a99ba0d42b98b51ac3fa124268422',
|
||||
]);
|
||||
|
||||
$helper = $fb->getRedirectLoginHelper();
|
||||
|
||||
try {
|
||||
$u = $cfg["main_url"] . '/f_modules/m_frontend/m_auth/fb_callback_register.php';
|
||||
$accessToken = $helper->getAccessToken($u);
|
||||
} catch (Facebook\Exceptions\FacebookResponseException $e) {
|
||||
// When Graph returns an error
|
||||
echo 'Graph returned an error: ' . $e->getMessage();
|
||||
exit;
|
||||
} catch (Facebook\Exceptions\FacebookSDKException $e) {
|
||||
// When validation fails or other local issues
|
||||
echo 'Facebook SDK returned an error: ' . $e->getMessage();
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!isset($accessToken)) {
|
||||
if ($helper->getError()) {
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
echo "Error: " . $helper->getError() . "\n";
|
||||
echo "Error Code: " . $helper->getErrorCode() . "\n";
|
||||
echo "Error Reason: " . $helper->getErrorReason() . "\n";
|
||||
echo "Error Description: " . $helper->getErrorDescription() . "\n";
|
||||
} else {
|
||||
header('HTTP/1.0 400 Bad Request');
|
||||
echo 'Bad request';
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
// Logged in
|
||||
|
||||
// The OAuth 2.0 client handler helps us manage access tokens
|
||||
$oAuth2Client = $fb->getOAuth2Client();
|
||||
// Get the access token metadata from /debug_token
|
||||
$tokenMetadata = $oAuth2Client->debugToken($accessToken);
|
||||
// Validation (these will throw FacebookSDKException's when they fail)
|
||||
$tokenMetadata->validateAppId($cfg['fb_app_id']); // Replace {app-id} with your app id
|
||||
// If you know the user ID this access token belongs to, you can validate it here
|
||||
$tokenMetadata->validateExpiration();
|
||||
|
||||
$user_id = $tokenMetadata->getUserId();
|
||||
|
||||
if (!$accessToken->isLongLived()) {
|
||||
// Exchanges a short-lived access token for a long-lived one
|
||||
try {
|
||||
$accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);
|
||||
} catch (Facebook\Exceptions\FacebookSDKException $e) {
|
||||
echo "<p>Error getting long-lived access token: " . $helper->getMessage() . "</p>\n\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$_SESSION['fb_access_token'] = (string) $accessToken;
|
||||
|
||||
try {
|
||||
// Returns a `Facebook\FacebookResponse` object
|
||||
$response = $fb->get('/me?fields=id,about,birthday,context,cover,currency,education,email,first_name,gender,hometown,picture.width(300).height(300),last_name,link,locale,location,middle_name,name,political,quotes,relationship_status,religion,significant_other,website', $accessToken);
|
||||
} catch (Facebook\Exceptions\FacebookResponseException $e) {
|
||||
echo 'Graph returned an error: ' . $e->getMessage();
|
||||
exit;
|
||||
} catch (Facebook\Exceptions\FacebookSDKException $e) {
|
||||
echo 'Facebook SDK returned an error: ' . $e->getMessage();
|
||||
exit;
|
||||
}
|
||||
|
||||
$user = $response->getGraphUser();
|
||||
|
||||
if (isset($user['birthday']->date)) {
|
||||
$a = $user['birthday']->date;
|
||||
$b = explode(' ', $a);
|
||||
$birthday = $b[0];
|
||||
} else {
|
||||
$birthday = '0000-00-00';
|
||||
}
|
||||
|
||||
$go = true;
|
||||
|
||||
if ($user_id and $go) {
|
||||
$rs = $db->execute(sprintf("SELECT `usr_id` FROM `db_accountuser` WHERE `oauth_provider`='facebook' AND `oauth_uid`='%s' LIMIT 1;", $user_id));
|
||||
|
||||
if ($rs->fields['usr_id']) {
|
||||
$usr_id = $rs->fields['usr_id'];
|
||||
$_SESSION["USER_ERROR"] = $language["notif.error.accout.linked"];
|
||||
$loc = $cfg["main_url"] . '/' . VHref::getKey('signin') . '?f=';
|
||||
|
||||
echo '<script type="text/javascript">opener.location="' . $loc . '"; window.close();</script>';
|
||||
|
||||
exit;
|
||||
} else {
|
||||
$_SESSION["fb_user"] = array(
|
||||
'id' => $user_id,
|
||||
'email' => $user['email'],
|
||||
'name' => $user['name'],
|
||||
'gender' => ($user['gender'] == 'male' ? 'M' : 'F'),
|
||||
'country' => (isset($user['user_location']->name) ? $user['user_location']->name : ''),
|
||||
'city' => (isset($user['user_location']->hometown) ? $user['user_location']->hometown : ''),
|
||||
'birth_date' => $birthday,
|
||||
'status' => 1,
|
||||
);
|
||||
|
||||
$loc = $cfg["main_url"] . '/' . VHref::getKey('signup') . '?u=' . $user_id;
|
||||
|
||||
echo '<script type="text/javascript">opener.location="' . $loc . '"; window.close();</script>';
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
108
f_modules/m_frontend/m_auth/gp_callback_login.php
Normal file
108
f_modules/m_frontend/m_auth/gp_callback_login.php
Normal file
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
/*******************************************************************************************************************
|
||||
| Software Name : EasyStream
|
||||
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
|
||||
| Software Author : (c) Sami Ahmed
|
||||
|*******************************************************************************************************************
|
||||
|
|
||||
|*******************************************************************************************************************
|
||||
| This source file is subject to the EasyStream Proprietary License Agreement.
|
||||
|
|
||||
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|
||||
|*******************************************************************************************************************
|
||||
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|
||||
|*******************************************************************************************************************/
|
||||
|
||||
define('_ISVALID', true);
|
||||
|
||||
$main_dir = realpath(dirname(__FILE__) . '/../../../');
|
||||
set_include_path($main_dir);
|
||||
|
||||
include_once 'f_core/config.core.php';
|
||||
|
||||
include_once 'f_core/f_classes/class_google/Google_Client.php';
|
||||
include_once 'f_core/f_classes/class_google/contrib/Google_Oauth2Service.php';
|
||||
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.global');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.recovery');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.signup');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.signin');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.notifications');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.email.notif');
|
||||
|
||||
$error_message = null;
|
||||
$notice_message = null;
|
||||
|
||||
$cfg = $class_database->getConfigurations('gp_auth,gp_app_id,gp_app_secret,list_reserved_users');
|
||||
|
||||
$clientId = $cfg['gp_app_id'];
|
||||
$clientSecret = $cfg['gp_app_secret'];
|
||||
$redirectUrl = $cfg['main_url'] . '/f_modules/m_frontend/m_auth/gp_callback_login.php';
|
||||
$homeUrl = $cfg['main_url'];
|
||||
|
||||
$gClient = new Google_Client();
|
||||
$gClient->setClientId($clientId);
|
||||
$gClient->setClientSecret($clientSecret);
|
||||
$gClient->setRedirectUri($redirectUrl);
|
||||
$google_oauthV2 = new Google_Oauth2Service($gClient);
|
||||
|
||||
if (isset($_GET['code'])) {
|
||||
$gClient->authenticate();
|
||||
$_SESSION['token'] = $gClient->getAccessToken();
|
||||
header('Location: ' . filter_var($redirectUrl, FILTER_SANITIZE_URL));
|
||||
}
|
||||
|
||||
if (isset($_SESSION['token'])) {
|
||||
$gClient->setAccessToken($_SESSION['token']);
|
||||
}
|
||||
|
||||
if ($gClient->getAccessToken()) {
|
||||
//logged in
|
||||
$userProfile = $google_oauthV2->userinfo->get();
|
||||
$user_id = $userProfile['id'];
|
||||
|
||||
if ($user_id) {
|
||||
$rs = $db->execute(sprintf("SELECT `usr_id` FROM `db_accountuser` WHERE `oauth_provider`='google' AND `oauth_uid`='%s' LIMIT 1;", $user_id));
|
||||
|
||||
if ($rs->fields['usr_id']) {
|
||||
$usr_id = $rs->fields['usr_id'];
|
||||
$reguser = VUserinfo::getUserInfo($usr_id);
|
||||
$loc = $cfg["main_url"] . '/' . VHref::getKey('account');
|
||||
echo '<script type="text/javascript">opener.location="' . $loc . '"; window.close();</script>';
|
||||
} else {
|
||||
$uu = explode('@', $userProfile['email']);
|
||||
$_SESSION["gp_user"] = array(
|
||||
'id' => $user_id,
|
||||
'email' => $userProfile['email'],
|
||||
'name' => $userProfile['name'],
|
||||
'picture' => $userProfile['picture'],
|
||||
'username' => $uu[0],
|
||||
'gender' => 'M',
|
||||
'country' => '',
|
||||
'city' => '',
|
||||
'birth_date' => '0000-00-00',
|
||||
'status' => 1,
|
||||
);
|
||||
|
||||
echo VSignup::auth_register_ajax();
|
||||
exit;
|
||||
|
||||
}
|
||||
|
||||
if ($reguser['key'] != '') {
|
||||
$_SESSION["USER_ID"] = $usr_id;
|
||||
$_SESSION["USER_NAME"] = $reguser['uname'];
|
||||
$_SESSION["USER_KEY"] = $reguser['key'];
|
||||
$_SESSION["USER_DNAME"] = $reguser['dname'];
|
||||
|
||||
$login_update = VLogin::updateOnLogin($usr_id);
|
||||
$log_activity = ($cfg["activity_logging"] == 1 and $action = new VActivity($usr_id, 0)) ? $action->addTo('log_signin') : null;
|
||||
|
||||
$loc = $cfg["main_url"] . '/' . VHref::getKey('account');
|
||||
|
||||
echo '<script type="text/javascript">opener.location="' . $loc . '"; window.close();</script>';
|
||||
} else {
|
||||
die('Account suspended!');
|
||||
}
|
||||
}
|
||||
}
|
||||
96
f_modules/m_frontend/m_auth/gp_callback_register.php
Normal file
96
f_modules/m_frontend/m_auth/gp_callback_register.php
Normal file
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
/*******************************************************************************************************************
|
||||
| Software Name : EasyStream
|
||||
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
|
||||
| Software Author : (c) Sami Ahmed
|
||||
|*******************************************************************************************************************
|
||||
|
|
||||
|*******************************************************************************************************************
|
||||
| This source file is subject to the EasyStream Proprietary License Agreement.
|
||||
|
|
||||
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|
||||
|*******************************************************************************************************************
|
||||
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|
||||
|*******************************************************************************************************************/
|
||||
|
||||
define('_ISVALID', true);
|
||||
|
||||
$main_dir = realpath(dirname(__FILE__) . '/../../../');
|
||||
set_include_path($main_dir);
|
||||
|
||||
include_once 'f_core/config.core.php';
|
||||
|
||||
include_once 'f_core/f_classes/class_google/Google_Client.php';
|
||||
include_once 'f_core/f_classes/class_google/contrib/Google_Oauth2Service.php';
|
||||
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.global');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.recovery');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.signup');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.signin');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.notifications');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.email.notif');
|
||||
|
||||
$error_message = null;
|
||||
$notice_message = null;
|
||||
|
||||
$cfg = $class_database->getConfigurations('gp_auth,gp_app_id,gp_app_secret');
|
||||
|
||||
$clientId = $cfg['gp_app_id'];
|
||||
$clientSecret = $cfg['gp_app_secret'];
|
||||
$redirectUrl = $cfg['main_url'] . '/f_modules/m_frontend/m_auth/gp_callback_register.php';
|
||||
$homeUrl = $cfg['main_url'];
|
||||
|
||||
$gClient = new Google_Client();
|
||||
$gClient->setClientId($clientId);
|
||||
$gClient->setClientSecret($clientSecret);
|
||||
$gClient->setRedirectUri($redirectUrl);
|
||||
$google_oauthV2 = new Google_Oauth2Service($gClient);
|
||||
|
||||
if (isset($_GET['code'])) {
|
||||
$gClient->authenticate();
|
||||
$_SESSION['token'] = $gClient->getAccessToken();
|
||||
|
||||
header('Location: ' . filter_var($redirectUrl, FILTER_SANITIZE_URL));
|
||||
}
|
||||
|
||||
if (isset($_SESSION['token'])) {
|
||||
$gClient->setAccessToken($_SESSION['token']);
|
||||
}
|
||||
|
||||
if ($gClient->getAccessToken()) {
|
||||
//logged in
|
||||
$user = $google_oauthV2->userinfo->get();
|
||||
$user_id = $user['id'];
|
||||
$user_email = $user['email'];
|
||||
$user_name = $user['name'];
|
||||
$user_gender = $user['gender'][0];
|
||||
$user_gender = $user_gender == '' ? 'M' : $user_gender;
|
||||
$user_bday = '0000-00-00';
|
||||
|
||||
$rs = $db->execute(sprintf("SELECT `usr_id` FROM `db_accountuser` WHERE `oauth_provider`='google' AND `oauth_uid`='%s' LIMIT 1;", $user_id));
|
||||
|
||||
if ($rs->fields['usr_id']) {
|
||||
$usr_id = $rs->fields['usr_id'];
|
||||
$_SESSION["USER_ERROR"] = $language["notif.error.accout.linked"];
|
||||
$loc = $cfg["main_url"] . '/' . VHref::getKey('signin') . '?f=';
|
||||
|
||||
echo '<script type="text/javascript">opener.location="' . $loc . '"; window.close();</script>';
|
||||
|
||||
exit;
|
||||
} else {
|
||||
$_SESSION["gp_user"] = array(
|
||||
'id' => $user_id,
|
||||
'email' => $user_email,
|
||||
'name' => $user_name,
|
||||
'gender' => $user_gender,
|
||||
'birth_date' => $user_bday,
|
||||
'status' => 1,
|
||||
);
|
||||
|
||||
$loc = $cfg["main_url"] . '/' . VHref::getKey('signup') . '?u=' . $user_id;
|
||||
|
||||
echo '<script type="text/javascript">opener.location="' . $loc . '"; window.close();</script>';
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
28
f_modules/m_frontend/m_auth/login.php
Normal file
28
f_modules/m_frontend/m_auth/login.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
if (!defined('_ISVALID')) define('_ISVALID', true);
|
||||
include_once 'f_core/config.core.php';
|
||||
|
||||
// Handle login
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$username = $_POST['username'] ?? '';
|
||||
$password = $_POST['password'] ?? '';
|
||||
|
||||
if ($username && $password) {
|
||||
$sql = "SELECT * FROM db_accountuser WHERE usr_user = ? AND usr_password = MD5(?) AND usr_active = 1";
|
||||
$user = $class_database->execute($sql, [$username, $password]);
|
||||
|
||||
if ($user && count($user) > 0) {
|
||||
$_SESSION['usr_id'] = $user[0]['usr_id'];
|
||||
$_SESSION['usr_user'] = $user[0]['usr_user'];
|
||||
$_SESSION['usr_key'] = $user[0]['usr_key'];
|
||||
|
||||
echo "<script>alert('Login successful! Redirecting...'); window.location.href='/';</script>";
|
||||
exit;
|
||||
} else {
|
||||
$error = 'Invalid credentials';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo $class_smarty->displayPage('frontend', 'tpl_auth_login');
|
||||
?>
|
||||
116
f_modules/m_frontend/m_auth/recovery.php
Normal file
116
f_modules/m_frontend/m_auth/recovery.php
Normal file
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
/*******************************************************************************************************************
|
||||
| Software Name : EasyStream
|
||||
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
|
||||
| Software Author : (c) Sami Ahmed
|
||||
|*******************************************************************************************************************
|
||||
|
|
||||
|*******************************************************************************************************************
|
||||
| This source file is subject to the EasyStream Proprietary License Agreement.
|
||||
|
|
||||
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|
||||
|*******************************************************************************************************************
|
||||
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|
||||
|*******************************************************************************************************************/
|
||||
|
||||
define('_ISVALID', true);
|
||||
|
||||
$main_dir = realpath(dirname(__FILE__) . '/../../../');
|
||||
set_include_path($main_dir);
|
||||
|
||||
include_once 'f_core/config.core.php';
|
||||
|
||||
include_once 'f_core/f_classes/class_recaptcha/autoload.php';
|
||||
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.global');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.recovery');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.signup');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.signin');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.notifications');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.email.notif');
|
||||
|
||||
$error_message = null;
|
||||
$notice_message = null;
|
||||
$notifier = new VNotify;
|
||||
|
||||
$cfg = $class_database->getConfigurations('activity_logging,password_recovery_captcha,username_recovery_captcha,recovery_link_lifetime,allow_username_recovery,allow_password_recovery,backend_username_recovery,backend_password_recovery,backend_username_recovery_captcha,backend_password_recovery_captcha,backend_username,backend_email,noreply_email,recaptcha_site_key,recaptcha_secret_key');
|
||||
$section_check = ($class_smarty->backendSectionCheck() == 1) ? 'backend' : 'frontend';
|
||||
$logged_in = $section_check == 'frontend' ? VLogin::isLoggedIn('fe') : ($section_check == 'backend' ? VLogin::isLoggedIn('be') : null);
|
||||
|
||||
$rec_username = $_POST["rec_username"] != '' ? $class_filter->clr_str($_POST["rec_username"]) : null;
|
||||
$rec_email = $_POST["rec_email"] != '' ? $class_filter->clr_str($_POST["rec_email"]) : null;
|
||||
$left_captcha = (($cfg["password_recovery_captcha"] == 1 or $cfg["backend_password_recovery_captcha"] == 1) and $_POST["g-recaptcha-response"] != '') ? $class_filter->clr_str($_POST["g-recaptcha-response"]) : null;
|
||||
$right_captcha = (($cfg["username_recovery_captcha"] == 1 or $cfg["backend_username_recovery_captcha"] == 1) and $_POST["g-recaptcha-response"] != '') ? $class_filter->clr_str($_POST["g-recaptcha-response"]) : null;
|
||||
|
||||
$pass_rec_cond = ($section_check == 'backend') ? $cfg["backend_password_recovery"] : $cfg["allow_password_recovery"];
|
||||
$pass_rec_captcha = ($section_check == 'backend') ? $cfg["backend_password_recovery_captcha"] : $cfg["password_recovery_captcha"];
|
||||
$user_rec_cond = ($section_check == 'backend') ? $cfg["backend_username_recovery"] : $cfg["allow_username_recovery"];
|
||||
$user_rec_captcha = ($section_check == 'backend') ? $cfg["backend_username_recovery_captcha"] : $cfg["username_recovery_captcha"];
|
||||
|
||||
$siteKey = $cfg['recaptcha_site_key'];
|
||||
$secret = $cfg['recaptcha_secret_key'];
|
||||
|
||||
switch (intval($_GET["t"])) {
|
||||
case '':break;
|
||||
case '0':break;
|
||||
case '1':
|
||||
if ($pass_rec_cond == 1) {
|
||||
switch ($pass_rec_captcha) {
|
||||
case '0':$password_recovery = (!VUserinfo::existingUsername($rec_username, $section_check)) ? $notifier->showNotice('error', $language["notif.error.invalid.request"]) : (VUserinfo::existingUsername($rec_username, $section_check)) ? VNotify::queInit('password_recovery', array(VUserinfo::getUserEmail(VUserinfo::getUserID($rec_username))), $section_check) . VNotify::showNotice('confirmation', $language["notif.success.request"], 'x_err') : null;
|
||||
break;
|
||||
case '1':
|
||||
if (!VUserinfo::existingUsername($rec_username, $section_check) or $left_captcha == '') {
|
||||
$notifier->showNotice('error', $language["notif.error.invalid.request"]);
|
||||
} elseif (VUserinfo::existingUsername($rec_username, $section_check)) {
|
||||
$recaptcha = new \ReCaptcha\ReCaptcha($secret, new \ReCaptcha\RequestMethod\CurlPost());
|
||||
$resp = $recaptcha->verify($left_captcha, $_SERVER[REM_ADDR]);
|
||||
|
||||
if ($resp->isSuccess()) {
|
||||
VNotify::queInit('password_recovery', array(VUserinfo::getUserEmail(VUserinfo::getUserID($rec_username))), $section_check) . VNotify::showNotice('confirmation', $language["notif.success.request"], 'x_err');
|
||||
} else {
|
||||
foreach ($resp->getErrorCodes() as $code) {
|
||||
$notifier->showNotice('error', $code);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
$log = ($cfg["activity_logging"] == 1 and $action = new VActivity($user_id, 0)) ? $action->addTo('log_urecovery') : null;
|
||||
}
|
||||
break;
|
||||
case '2':
|
||||
if ($user_rec_cond == 1) {
|
||||
switch ($user_rec_captcha) {
|
||||
case '0':$username_recovery = (!VUserinfo::existingEmail($rec_email, $section_check)) ? $notifier->showNotice('error', $language["notif.error.invalid.request"], 'r_err') : (VUserinfo::existingEmail($rec_email, $section_check)) ? VNotify::queInit('username_recovery', array($rec_email), $section_check) . VNotify::showNotice('confirmation', $language["notif.success.request"], 'r_err') : null;
|
||||
break;
|
||||
case '1':
|
||||
if (!VUserinfo::existingEmail($rec_email, $section_check) or $right_captcha == '') {
|
||||
$notifier->showNotice('error', $language["notif.error.invalid.request"], 'r_err');
|
||||
} elseif (VUserinfo::existingEmail($rec_email, $section_check)) {
|
||||
$recaptcha = new \ReCaptcha\ReCaptcha($secret, new \ReCaptcha\RequestMethod\CurlPost());
|
||||
$resp = $recaptcha->verify($right_captcha, $_SERVER[REM_ADDR]);
|
||||
|
||||
if ($resp->isSuccess()) {
|
||||
VNotify::queInit('username_recovery', array($rec_email), $section_check) . VNotify::showNotice('confirmation', $language["notif.success.request"], 'r_err');
|
||||
} else {
|
||||
foreach ($resp->getErrorCodes() as $code) {
|
||||
$notifier->showNotice('error', $code);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
$log = ($cfg["activity_logging"] == 1 and $action = new VActivity($user_id, 0)) ? $action->addTo('log_precovery') : null;
|
||||
}
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
if (intval($_POST["reset_password"] == 1) or ($_GET["s"] != '' and $_GET["id"] != '')) {
|
||||
$error_message = ($_GET["s"] != '' and $_GET["id"] != '') ? VRecovery::validCheck($section_check) : null;
|
||||
$error_message = (intval($_POST["reset_password"] == 1) and $error_message == '') ? VRecovery::processForm($section_check) : $error_message;
|
||||
$notice_message = ((intval($_POST["reset_password"] == 1)) and ($error_message == '' and VRecovery::doPasswordReset($section_check))) ? $language["recovery.forgot.password.confirm"] : null;
|
||||
}
|
||||
|
||||
$u = VUserinfo::getUserInfo(VRecovery::getRecoveryID($_GET["s"]));
|
||||
$recovery_username = ($_GET["s"] != '' and $_GET["id"] != '' and $section_check == 'frontend') ? $smarty->assign('fe_recovery_username', $u["uname"]) : ($_GET["s"] != '' and $_GET["id"] != '' and $section_check == 'backend') ? $smarty->assign('recovery_username', $cfg["backend_username"]) : null;
|
||||
$page_display = ($_GET["t"] == '') ? $class_smarty->displayPage($section_check, ($section_check == 'frontend' ? 'tpl_recovery' : 'backend_tpl_recovery'), $error_message, $notice_message) : null;
|
||||
8
f_modules/m_frontend/m_auth/renew.php
Normal file
8
f_modules/m_frontend/m_auth/renew.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
define("_ISVALID", true);
|
||||
include_once "f_core/config.core.php";
|
||||
// Password renewal - basic implementation
|
||||
echo "<h1>Password Renewal</h1>";
|
||||
echo "<p>Password renewal functionality coming soon...</p>";
|
||||
echo "<a href=\"/signin\">← Back to Sign In</a>";
|
||||
?>
|
||||
85
f_modules/m_frontend/m_auth/signin.php
Normal file
85
f_modules/m_frontend/m_auth/signin.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/*******************************************************************************************************************
|
||||
| Software Name : EasyStream
|
||||
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
|
||||
| Software Author : (c) Sami Ahmed
|
||||
|*******************************************************************************************************************
|
||||
|
|
||||
|*******************************************************************************************************************
|
||||
| This source file is subject to the EasyStream Proprietary License Agreement.
|
||||
|
|
||||
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|
||||
|*******************************************************************************************************************
|
||||
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|
||||
|*******************************************************************************************************************/
|
||||
|
||||
define('_ISVALID', true);
|
||||
|
||||
$main_dir = realpath(dirname(__FILE__) . '/../../../');
|
||||
set_include_path($main_dir);
|
||||
|
||||
include_once 'f_core/config.core.php';
|
||||
include_once 'f_core/f_classes/class_recaptcha/autoload.php';
|
||||
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.global');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.signin');
|
||||
|
||||
$error_message = isset($_SESSION["USER_ERROR"]) ? $_SESSION["USER_ERROR"] : null;
|
||||
$notice_message = null;
|
||||
$cfg = $class_database->getConfigurations('login_remember,paid_memberships,frontend_signin_section,frontend_signin_count,fb_app_id,fb_app_secret,fb_auth,gp_app_id,gp_app_secret,gp_auth,recaptcha_site_key,recaptcha_secret_key,signin_captcha,list_reserved_users');
|
||||
$_SESSION["renew_id"] = $cfg["paid_memberships"] == 1 ? '' : null;
|
||||
|
||||
if ($cfg['gp_auth'] == 1 and $cfg["frontend_signin_section"] == 1) {
|
||||
//google authentication
|
||||
include_once 'f_core/f_classes/class_google/Google_Client.php';
|
||||
include_once 'f_core/f_classes/class_google/contrib/Google_Oauth2Service.php';
|
||||
|
||||
$clientId = $cfg['gp_app_id'];
|
||||
$clientSecret = $cfg['gp_app_secret'];
|
||||
$redirectUrl = $cfg['main_url'] . '/f_modules/m_frontend/m_auth/gp_callback_login.php';
|
||||
$homeUrl = $cfg['main_url'];
|
||||
|
||||
$gClient = new Google_Client();
|
||||
$gClient->setAccessType('online');
|
||||
$gClient->setApprovalPrompt('auto');
|
||||
$gClient->setClientId($clientId);
|
||||
$gClient->setClientSecret($clientSecret);
|
||||
$gClient->setRedirectUri($redirectUrl);
|
||||
|
||||
$google_oauthV2 = new Google_Oauth2Service($gClient);
|
||||
|
||||
$authUrl = $gClient->createAuthUrl();
|
||||
|
||||
$smarty->assign('gp_loginUrl', htmlspecialchars($authUrl));
|
||||
}
|
||||
|
||||
if ($cfg['fb_auth'] == 1 and $cfg["frontend_signin_section"] == 1) {
|
||||
//facebook authentication
|
||||
include_once 'f_core/f_classes/class_facebook/Facebook/autoload.php';
|
||||
|
||||
$fb = new Facebook\Facebook([
|
||||
'app_id' => $cfg['fb_app_id'],
|
||||
'app_secret' => $cfg['fb_app_secret'],
|
||||
'default_graph_version' => 'v2.7',
|
||||
'default_access_token' => '1061711193887319|fc3a99ba0d42b98b51ac3fa124268422',
|
||||
]);
|
||||
|
||||
$fb_helper = $fb->getRedirectLoginHelper();
|
||||
$fb_permissions = ['email']; // Optional permissions
|
||||
$fb_loginUrl = $fb_helper->getLoginUrl($cfg['main_url'] . '/f_modules/m_frontend/m_auth/fb_callback_login.php', $fb_permissions);
|
||||
|
||||
$smarty->assign('fb_loginUrl', htmlspecialchars($fb_loginUrl));
|
||||
}
|
||||
|
||||
if (intval($_POST["frontend_global_submit"] == 1) and $cfg["frontend_signin_section"] == 1) {
|
||||
//regular login
|
||||
$remember = ($error_message == '' and intval($_POST["signin_remember"]) == 1) ? 1 : null;
|
||||
$error_message = !VLogin::loginAttempt('frontend', $class_filter->clr_str($_POST["frontend_signin_username"]), $_POST["frontend_signin_password"], $remember) ? $language["frontend.signin.error.auth"] : null;
|
||||
}
|
||||
|
||||
$remember = ($cfg["login_remember"] == 1 and $cfg["frontend_signin_section"] == 1) ? VLoginRemember::checkLogin('frontend') : null;
|
||||
$logged_in = VLogin::isLoggedIn();
|
||||
|
||||
$class_smarty->displayPage('frontend', 'tpl_signin', $error_message, $notice_message);
|
||||
|
||||
$_SESSION["USER_ERROR"] = null;
|
||||
25
f_modules/m_frontend/m_auth/signout.php
Normal file
25
f_modules/m_frontend/m_auth/signout.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/*******************************************************************************************************************
|
||||
| Software Name : EasyStream
|
||||
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
|
||||
| Software Author : (c) Sami Ahmed
|
||||
|*******************************************************************************************************************
|
||||
|
|
||||
|*******************************************************************************************************************
|
||||
| This source file is subject to the EasyStream Proprietary License Agreement.
|
||||
|
|
||||
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|
||||
|*******************************************************************************************************************
|
||||
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|
||||
|*******************************************************************************************************************/
|
||||
|
||||
define('_ISVALID', true);
|
||||
|
||||
include_once 'f_core/config.core.php';
|
||||
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.global');
|
||||
|
||||
$error_message = null;
|
||||
$notice_message = null;
|
||||
|
||||
$signout = VLogin::logoutAttempt('frontend');
|
||||
73
f_modules/m_frontend/m_auth/signup.php
Normal file
73
f_modules/m_frontend/m_auth/signup.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/*******************************************************************************************************************
|
||||
| Software Name : EasyStream
|
||||
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
|
||||
| Software Author : (c) Sami Ahmed
|
||||
|*******************************************************************************************************************
|
||||
|
|
||||
|*******************************************************************************************************************
|
||||
| This source file is subject to the EasyStream Proprietary License Agreement.
|
||||
|
|
||||
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|
||||
|*******************************************************************************************************************
|
||||
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|
||||
|*******************************************************************************************************************/
|
||||
|
||||
define('_ISVALID', true);
|
||||
|
||||
$main_dir = realpath(dirname(__FILE__) . '/../../../');
|
||||
set_include_path($main_dir);
|
||||
|
||||
include_once 'f_core/config.core.php';
|
||||
|
||||
include_once 'f_core/f_classes/class_recaptcha/autoload.php';
|
||||
include_once 'f_core/f_classes/class_facebook/Facebook/autoload.php';
|
||||
|
||||
include_once $class_language->setLanguageFile('backend', 'language.members.entries');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.global');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.notifications');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.signup');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.signin');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.welcome');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.email.notif');
|
||||
|
||||
$error_message = null;
|
||||
$notice_message = null;
|
||||
|
||||
$cfg = $class_database->getConfigurations('global_signup,signup_ip_access,list_ip_signup,disabled_signup_message,reserved_usernames,frontend_signin_section,frontend_signin_count,signup_min_age,signup_max_age,signup_min_password,signup_max_password,signup_min_username,signup_max_username,paid_memberships,numeric_delimiter,paypal_email,paypal_test,paypal_test_email,signup_username_availability,signup_password_meter,signup_captcha,signup_domain_restriction,list_email_domains,list_reserved_users,signup_terms,username_format,username_format_dott,username_format_dash,username_format_underscore,discount_codes,account_email_verification,account_approval,notify_welcome,paypal_payments,approve_friends,backend_notification_payment,backend_notification_signup,backend_email,backend_username,recaptcha_site_key,recaptcha_secret_key,fb_app_id,fb_app_secret,fb_auth,gp_app_id,gp_app_secret,gp_auth');
|
||||
$pack_class = ($cfg["paid_memberships"] == 1 and $cfg["global_signup"] == 1 and $error_message == '') ? include_once 'f_core/f_classes/class.payment.php' : null;
|
||||
$logged_in = (($_GET["do"] == 'continue' or $_GET["do"] == 'process') and intval($_SESSION["USER_ID"]) > 0 and intval($_SESSION["renew_id"]) == intval($_SESSION["USER_ID"])) ? null : VLogin::isLoggedIn();
|
||||
$error_message = ($cfg["signup_ip_access"] == 1 and !VIPaccess::checkIPlist($cfg["list_ip_signup"])) ? $smarty->assign('do_disable', 'yes') : null;
|
||||
$memberships = ($cfg["paid_memberships"] == 1 and $cfg["global_signup"] == 1 and $error_message == '') ? VPayment::getPackTypes() : null;
|
||||
//form sessions will be reset, unless we're dealing with the second form
|
||||
$formSessionReset = (intval($_POST["signup_submit_right"] != 1)) ? VSignup::formSessionReset() : null;
|
||||
|
||||
if (intval($_POST["frontend_global_submit"] == 1) and $cfg["global_signup"] == 1) {
|
||||
//left form has been submitted
|
||||
$form_fields = VArraySection::getArray('signup');
|
||||
$allowedFields = $form_fields[1];
|
||||
$requiredFields = $allowedFields;
|
||||
|
||||
$error_message = VSignup::processForm($allowedFields, $requiredFields);
|
||||
$notice_message = ($error_message == '' and VSignup::formSessionInit()) ? $language["notif.notice.signup.step1"] : null;
|
||||
$notice_message = ($error_message == '' and VSignup::processAccount()) ? $language["notif.notice.signup.success"] . $cfg["website_shortname"] . ($cfg["account_approval"] == 1 ? '. ' . $language["notif.notice.signup.approve"] : null) : null;
|
||||
$user_info = ($cfg["paid_memberships"] == 1 and $notice_message != '') ? VPayment::getUserPack() : VUserinfo::getUserEmail();
|
||||
}
|
||||
if (($cfg['fb_auth'] == 1 or $cfg['gp_auth'] == 1) and $_POST and isset($_GET["do"]) and $_GET["do"] == 'auth_register') {
|
||||
// $auth = VSignup::auth_register_ajax();
|
||||
}
|
||||
|
||||
//free account update
|
||||
$notice_message = ($cfg["global_signup"] == 1 and $cfg["paid_memberships"] == 1 and $_GET["p"] != '' and $_GET["u"] != '' and $_POST["signup_finalize"] == 1) ? VPayment::updateFreeEntry() : $notice_message;
|
||||
//payment processing
|
||||
$payment_prepare = ($cfg["global_signup"] == 1 and $cfg["paid_memberships"] == 1 and $_GET["p"] != '' and $_GET["u"] != '') ? VPayment::preparePayment() : null;
|
||||
$payment_confirm = ($cfg["global_signup"] == 1 and $cfg["paid_memberships"] == 1 and $_GET["do"] == 'continue') ? VPayment::continuePayment() : null;
|
||||
$payment_process = ($cfg["global_signup"] == 1 and $cfg["paid_memberships"] == 1 and ($_GET["do"] == 'process' or $_GET["do"] == 'ipn' or $_GET["do"] == 'success' or $_GET["do"] == 'cancel')) ? VPayment::doPayment($_GET["do"]) : null;
|
||||
//username avail.
|
||||
$username_check = (($cfg["signup_username_availability"] == 1 and $cfg["global_signup"] == 1) and ($_GET["do"] == 'ucheck' and strlen($_POST["frontend_signin_username"]) > 0)) ? VUserinfo::usernameAvailability($_POST["frontend_signin_username"]) : null;
|
||||
//fb register
|
||||
$fb_register = ($cfg['fb_auth'] == 1 and !isset($_GET["do"])) ? $smarty->assign('fb_register', VSignup::fb_register_button()) : null;
|
||||
//gp register
|
||||
$gp_register = ($cfg['gp_auth'] == 1 and !isset($_GET["do"])) ? $smarty->assign('gp_register', VSignup::gp_register_button()) : null;
|
||||
//page
|
||||
$display_page = !isset($_GET["do"]) ? $class_smarty->displayPage('frontend', 'tpl_signup', $error_message, $notice_message) : null;
|
||||
35
f_modules/m_frontend/m_auth/verify.php
Normal file
35
f_modules/m_frontend/m_auth/verify.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*******************************************************************************************************************
|
||||
| Software Name : EasyStream
|
||||
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
|
||||
| Software Author : (c) Sami Ahmed
|
||||
|*******************************************************************************************************************
|
||||
|
|
||||
|*******************************************************************************************************************
|
||||
| This source file is subject to the EasyStream Proprietary License Agreement.
|
||||
|
|
||||
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|
||||
|*******************************************************************************************************************
|
||||
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|
||||
|*******************************************************************************************************************/
|
||||
|
||||
define('_ISVALID', true);
|
||||
|
||||
include_once 'f_core/config.core.php';
|
||||
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.global');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.signin');
|
||||
include_once $class_language->setLanguageFile('frontend', 'language.notifications');
|
||||
|
||||
$error_message = null;
|
||||
$notice_message = null;
|
||||
$cfg = $class_database->getConfigurations('account_email_verification');
|
||||
|
||||
if ($error_message == '' and isset($_GET["sid"]) and isset($_GET["uid"])) {
|
||||
$error_message = VRecovery::validCheck('frontend', 'verification');
|
||||
$notice_message = ($error_message == '' and VSignup::verifyAccount()) ? $language["notif.success.verified"] : null;
|
||||
} elseif ($cfg["account_email_verification"] == 0) {
|
||||
$error_message = 'tpl_error_max';
|
||||
}
|
||||
|
||||
$class_smarty->displayPage('frontend', 'tpl_verify', $error_message, $notice_message);
|
||||
Reference in New Issue
Block a user