Files
easystream-main/f_modules/m_frontend/m_auth/signin.php
SamiAhmed7777 0b7e2d0a5b 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
2025-10-21 00:39:45 -07:00

86 lines
4.1 KiB
PHP

<?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;