1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00

Le add a birth date on user profile

This commit is contained in:
Daniel Neto 2024-01-08 14:34:32 -03:00
parent 010579d72b
commit f0ec84e7a0
12 changed files with 251 additions and 124 deletions

View file

@ -5,7 +5,7 @@ if (file_exists("../videos/configuration.php")) {
} }
$installationVersion = "14.1"; $installationVersion = "14.2";
require_once '../objects/functionSecurity.php'; require_once '../objects/functionSecurity.php';

View file

@ -41,6 +41,7 @@ CREATE TABLE IF NOT EXISTS `users` (
`extra_info` TEXT NULL DEFAULT NULL, `extra_info` TEXT NULL DEFAULT NULL,
`phone` VARCHAR(255) NULL DEFAULT NULL, `phone` VARCHAR(255) NULL DEFAULT NULL,
`is_company` TINYINT(4) NULL DEFAULT NULL, `is_company` TINYINT(4) NULL DEFAULT NULL,
`birth_date` DATE NULL DEFAULT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE INDEX `user_UNIQUE` (`user` ASC)) UNIQUE INDEX `user_UNIQUE` (`user` ASC))
ENGINE = InnoDB; ENGINE = InnoDB;

View file

@ -250,6 +250,7 @@ $object->canStream = User::canStream();
$object->redirectUri = @$_POST['redirectUri']; $object->redirectUri = @$_POST['redirectUri'];
$object->embedChatUrl = ''; $object->embedChatUrl = '';
$object->embedChatUrlMobile = ''; $object->embedChatUrlMobile = '';
$object->age = User::getAge();
//_error_log("login.json.php check chat2"); //_error_log("login.json.php check chat2");
if (AVideoPlugin::isEnabledByName('Chat2') && method_exists('Chat2', 'getChatRoomLink')) { if (AVideoPlugin::isEnabledByName('Chat2') && method_exists('Chat2', 'getChatRoomLink')) {

View file

@ -58,6 +58,7 @@ class User
private $extra_info; private $extra_info;
private $phone; private $phone;
private $is_company; private $is_company;
private $birth_date;
public static $DOCUMENT_IMAGE_TYPE = "Document Image"; public static $DOCUMENT_IMAGE_TYPE = "Document Image";
public static $channel_artTV = 'tv'; public static $channel_artTV = 'tv';
public static $channel_artDesktopMax = 'desktop_max'; public static $channel_artDesktopMax = 'desktop_max';
@ -123,6 +124,17 @@ class User
$this->phone = $phone; $this->phone = $phone;
} }
function getBirth_date()
{
return $this->birth_date;
}
function setBirth_date($birth_date): void
{
$time = strtotime($birth_date);
$this->birth_date = date('Y/m/d', $time);
}
public function getEmail() public function getEmail()
{ {
return $this->email; return $this->email;
@ -629,7 +641,7 @@ if (typeof gtag !== \"function\") {
global $global; global $global;
$photo = self::_getPhoto($users_id); $photo = self::_getPhoto($users_id);
if ($photo == ImagesPlaceHolders::getUserIcon()) { if ($photo == ImagesPlaceHolders::getUserIcon()) {
return $global['systemRootPath'].($photo); return $global['systemRootPath'] . ($photo);
} }
if (empty($photo)) { if (empty($photo)) {
return false; return false;
@ -727,7 +739,7 @@ if (typeof gtag !== \"function\") {
//echo "u:" . $this->user . "|p:" . strlen($this->password); //echo "u:" . $this->user . "|p:" . strlen($this->password);
if (empty($this->user)) { if (empty($this->user)) {
//echo "u:" . $this->user . "|p:" . strlen($this->password); //echo "u:" . $this->user . "|p:" . strlen($this->password);
_error_log('Error : 1 You need a user to register '.json_encode(debug_backtrace())); _error_log('Error : 1 You need a user to register ' . json_encode(debug_backtrace()));
return false; return false;
} }
if (empty($this->password)) { if (empty($this->password)) {
@ -799,6 +811,11 @@ if (typeof gtag !== \"function\") {
$values[] = $this->canViewChart; $values[] = $this->canViewChart;
$sql .= "canViewChart = ?, "; $sql .= "canViewChart = ?, ";
} }
if (!empty($this->birth_date)) {
$formats .= "s";
$values[] = $this->birth_date;
$sql .= "birth_date = ?, ";
}
$formats .= "ssssssisssssssssssi"; $formats .= "ssssssisssssssssssi";
$values[] = $this->status; $values[] = $this->status;
$values[] = $this->photoURL; $values[] = $this->photoURL;
@ -1109,7 +1126,7 @@ if (typeof gtag !== \"function\") {
return self::USER_LOGGED; return self::USER_LOGGED;
} }
global $global, $advancedCustom, $advancedCustomUser, $config; global $global, $advancedCustom, $advancedCustomUser, $config;
if(class_exists('AVideoPlugin')){ if (class_exists('AVideoPlugin')) {
if (empty($advancedCustomUser)) { if (empty($advancedCustomUser)) {
$advancedCustomUser = AVideoPlugin::getObjectData("CustomizeUser"); $advancedCustomUser = AVideoPlugin::getObjectData("CustomizeUser");
} }
@ -1340,6 +1357,39 @@ if (typeof gtag !== \"function\") {
return !empty($_SESSION['user']['isAdmin']); return !empty($_SESSION['user']['isAdmin']);
} }
public static function getBirthIfIsSet($users_id = 0)
{
$birth_date = '';
if (!empty($users_id)) {
$user = new User($users_id);
$birth_date = $user->getBirth_date();
} else {
self::recreateLoginFromCookie();
$birth_date = $_SESSION['user']['birth_date'];
}
return $birth_date;
}
public static function getAge($users_id = 0)
{
$birth_date = self::getBirthIfIsSet($users_id);
if (empty($birth_date)) {
return 0;
}
$birth_date = new DateTime($birth_date);
$current_date = new DateTime('now');
$age = $current_date->diff($birth_date)->y;
if($age<0){
return 0;
}
return $age;
}
public static function isOver18($users_id = 0): bool
{
return self::getAge($users_id) > 18;
}
public static function isACompany($users_id = 0) public static function isACompany($users_id = 0)
{ {
global $_is_a_company; global $_is_a_company;
@ -1978,11 +2028,11 @@ if (typeof gtag !== \"function\") {
global $global; global $global;
$sql = "SELECT * "; $sql = "SELECT * ";
if(!empty($_REQUEST['getUsage'])){ if (!empty($_REQUEST['getUsage'])) {
$sql .=", (SELECT sum(filesize) as total FROM videos WHERE filesize > 0 AND (users_id = u.id)) as usageInBytes"; $sql .= ", (SELECT sum(filesize) as total FROM videos WHERE filesize > 0 AND (users_id = u.id)) as usageInBytes";
} }
$sql .=" FROM users u WHERE 1=1 "; $sql .= " FROM users u WHERE 1=1 ";
if (!empty($status)) { if (!empty($status)) {
if (strtolower($status) === 'i') { if (strtolower($status) === 'i') {
$sql .= " AND status = 'i' "; $sql .= " AND status = 'i' ";
@ -2303,7 +2353,7 @@ if (typeof gtag !== \"function\") {
global $global, $config, $advancedCustomUser; global $global, $config, $advancedCustomUser;
$reason = []; $reason = [];
if (empty($doNotCheckPlugins) && !AVideoPlugin::userCanUpload(User::getId())) { if (empty($doNotCheckPlugins) && !AVideoPlugin::userCanUpload(User::getId())) {
$reason[] = 'A plugin said users_id=['.User::getId().'] cannot upload'; $reason[] = 'A plugin said users_id=[' . User::getId() . '] cannot upload';
} }
if ((isset($advancedCustomUser->onlyVerifiedEmailCanUpload) && $advancedCustomUser->onlyVerifiedEmailCanUpload && !User::isVerified())) { if ((isset($advancedCustomUser->onlyVerifiedEmailCanUpload) && $advancedCustomUser->onlyVerifiedEmailCanUpload && !User::isVerified())) {
@ -2677,7 +2727,7 @@ if (typeof gtag !== \"function\") {
$msg .= "<br><br>" . __($advancedCustomUser->verificationMailTextLine4); $msg .= "<br><br>" . __($advancedCustomUser->verificationMailTextLine4);
$msg .= "<br><br>" . " <a href='{$global['webSiteRootURL']}objects/userVerifyEmail.php?code={$code}'>" . __("Verify") . "</a>"; $msg .= "<br><br>" . " <a href='{$global['webSiteRootURL']}objects/userVerifyEmail.php?code={$code}'>" . __("Verify") . "</a>";
$resp = sendSiteEmail($user->getEmail(), __('Please Verify Your E-mail '). ' ' . $webSiteTitle, $msg); $resp = sendSiteEmail($user->getEmail(), __('Please Verify Your E-mail ') . ' ' . $webSiteTitle, $msg);
if (!$resp) { if (!$resp) {
_error_log("sendVerificationLink Error Info: {$mail->ErrorInfo}"); _error_log("sendVerificationLink Error Info: {$mail->ErrorInfo}");

View file

@ -51,6 +51,7 @@ $user->setStatus($_POST['status']);
$user->setEmailVerified($_POST['isEmailVerified']); $user->setEmailVerified($_POST['isEmailVerified']);
$user->setAnalyticsCode($_POST['analyticsCode']); $user->setAnalyticsCode($_POST['analyticsCode']);
$user->setPhone($_POST['phone']); $user->setPhone($_POST['phone']);
$user->setBirth_date($_POST['birth']);
_error_log("userAddNew.json.php: set channel name = ({$_POST['channelName']})"); _error_log("userAddNew.json.php: set channel name = ({$_POST['channelName']})");

View file

@ -29,6 +29,7 @@ $user->setAbout($_POST['about']);
$user->setAnalyticsCode($_POST['analyticsCode']); $user->setAnalyticsCode($_POST['analyticsCode']);
$user->setDonationLink($_POST['donationLink']); $user->setDonationLink($_POST['donationLink']);
$user->setPhone($_POST['phone']); $user->setPhone($_POST['phone']);
$user->setBirth_date($_POST['birth_date']);
$unique = $user->setChannelName($_POST['channelName']); $unique = $user->setChannelName($_POST['channelName']);
if (!$unique) { if (!$unique) {
$obj->msg = __("Channel name already exists"); $obj->msg = __("Channel name already exists");

View file

@ -1841,7 +1841,6 @@ if (!class_exists('Video')) {
_error_log("Video::updateLikesDislikes: id={$row['id']}"); _error_log("Video::updateLikesDislikes: id={$row['id']}");
$row['dislikes'] = self::updateLikesDislikes($row['id'], 'dislikes'); $row['dislikes'] = self::updateLikesDislikes($row['id'], 'dislikes');
} }
if (empty($row['duration_in_seconds']) && in_array($row['type'], $allowedDurationTypes)) { if (empty($row['duration_in_seconds']) && in_array($row['type'], $allowedDurationTypes)) {
_error_log("Video::duration_in_seconds: id={$row['id']} {$row['duration']} {$row['type']}"); _error_log("Video::duration_in_seconds: id={$row['id']} {$row['duration']} {$row['type']}");
$row['duration_in_seconds'] = self::updateDurationInSeconds($row['id'], $row['duration']); $row['duration_in_seconds'] = self::updateDurationInSeconds($row['id'], $row['duration']);
@ -1996,6 +1995,7 @@ if (!class_exists('Video')) {
$row['views_count_short'] = number_format_short($row['views_count']); $row['views_count_short'] = number_format_short($row['views_count']);
TimeLogEnd($timeLogName, __LINE__, $TimeLogLimit); TimeLogEnd($timeLogName, __LINE__, $TimeLogLimit);
$row['identification'] = User::getNameIdentificationById(!empty($row['users_id_company']) ? $row['users_id_company'] : $row['users_id']); $row['identification'] = User::getNameIdentificationById(!empty($row['users_id_company']) ? $row['users_id_company'] : $row['users_id']);
$row['age'] = User::getAge($row['users_id']);
if (empty($row['externalOptions'])) { if (empty($row['externalOptions'])) {
$row['externalOptions'] = json_encode(['videoStartSeconds' => '00:00:00']); $row['externalOptions'] = json_encode(['videoStartSeconds' => '00:00:00']);

View file

@ -1,6 +1,6 @@
<?php <?php
require_once dirname(__FILE__) . '/../../videos/configuration.php'; require_once dirname(__FILE__) . '/../../videos/configuration.php';
$global['doNotLoadPlayer'] = 1;
setIsConfirmationPage(); setIsConfirmationPage();
$images = Video::getImageFromFilename($video['filename']); $images = Video::getImageFromFilename($video['filename']);
$img = $images->poster; $img = $images->poster;
@ -11,82 +11,108 @@ $imgw = 1280;
$imgh = 720; $imgh = 720;
$metaDescription = $title = getSEOTitle($video['title']); $metaDescription = $title = getSEOTitle($video['title']);
$ogURL = Video::getLinkToVideo($video['id'], $video['clean_title'], false, false); $ogURL = Video::getLinkToVideo($video['id'], $video['clean_title'], false, false);
$_page = new Page(array('Confirm Rating'));
?> ?>
<!DOCTYPE html> <style>
<html lang="<?php echo getLanguage(); ?>"> #bg {
<head> position: fixed;
<title><?php echo __("Confirm Rating") . $config->getPageTitleSeparator() . $title; ?></title> width: 100%;
<?php height: 100%;
include $global['systemRootPath'] . 'view/include/head.php'; background-image: url('<?php echo $images->poster; ?>');
?> background-size: cover;
<style> opacity: 0.3;
body { filter: alpha(opacity=30);
padding-top: 0; z-index: -1;
} /* For IE8 and earlier */
footer{ }
display: none; </style>
} <div id="bg"></div>
#bg{ <div class="container">
position: fixed; <div class="panel panel-danger">
width: 100%; <div class="panel-heading">
height: 100%; <h1>
background-image: url('<?php echo $images->poster; ?>'); <?php echo $video['title']; ?>
background-size: cover; </h1>
opacity: 0.3; </div>
filter: alpha(opacity=30); /* For IE8 and earlier */ <div class="panel-body">
} <div class="row">
</style> <div class="col-sm-2">
</head> <?php
<body class="<?php echo $global['bodyClass']; ?>"> echo Video::getRratingIMG($video['rrating']);
<?php ?>
//include $global['systemRootPath'] . 'view/include/navbar.php'; </div>
?> <div class="col-sm-4">
<div id="bg"></div> <img src="<?php echo $img; ?>" class="img img-responsive" />
</div>
<!-- Modal --> <div class="col-sm-6 text-center">
<div id="myModal" class="modal fade in" role="dialog"> <?php
<div class="modal-dialog"> echo Video::getRratingText($video['rrating']);
?>
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h2 class="modal-title">
<?php echo $video['title']; ?>
</h2>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-2">
<?php
echo Video::getRratingIMG($video['rrating']);
?>
</div>
<div class="col-sm-4">
<img src="<?php echo $img; ?>" class="img img-responsive"/>
</div>
<div class="col-sm-6 text-center">
<?php
echo Video::getRratingText($video['rrating']);
?>
</div>
</div>
</div>
<div class="modal-footer" >
<a href="<?php echo $_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], "?") === false ? "?" : "&"; ?>rrating=1" class="btn btn-success pull-right"><i class="fas fa-check-circle"></i> <?php echo __("Confirm"); ?></a>
<a href="<?php echo getHomePageURL(); ?>" class="btn btn-danger pull-right"><i class="fas fa-times-circle"></i> <?php echo __("Cancel"); ?></a>
</div>
</div> </div>
</div> </div>
</div> </div>
<?php <div class="panel-footer">
include $global['systemRootPath'] . 'view/include/footer.php'; <?php
?> $canAccept = true;
<script type="text/javascript"> if ($video['rrating'] == 'ma') { // if is mature
$(window).on('load', function () { if (!User::isLogged()) {
$('#myModal').modal('show'); $canAccept = false;
}); ?>
</script> <div class="alert alert-warning">
</body> <strong><?php echo __('Sign In Required'); ?></strong>
</html> <p><?php echo __('This content is for viewers 18+'); ?></p>
<a href="<?php echo $global['webSiteRootURL']; ?>user" class="btn btn-primary btn-block">
<i class="fa-solid fa-right-to-bracket"></i>
<?php echo __('Sign In'); ?>
</a>
</div>
<?php
} else {
$birth_date = User::getBirthIfIsSet();
if (empty($birth_date)) {
$canAccept = false;
?>
<div class="alert alert-danger">
<strong><?php echo __('Age Confirmation Needed'); ?></strong>
<p><?php echo __('Please update your birth date in your profile to access this content'); ?></p>
<a href="<?php echo $global['webSiteRootURL']; ?>user" class="btn btn-primary btn-block">
<i class="fa-solid fa-clipboard-check"></i>
<?php echo __('Update Profile'); ?>
</a>
</div>
<?php
} else if (!User::isOver18()) {
$canAccept = false;
?>
<div class="alert alert-info">
<strong><?php echo __('Content Not Available'); ?></strong>
<p><?php echo __('This content is restricted to viewers 18 and over'); ?></p>
<a href="<?php echo $global['webSiteRootURL']; ?>user" class="btn btn-primary btn-block">
<i class="fa-solid fa-house"></i>
<?php echo __('Home'); ?>
</a>
</div>
<?php
}
}
}
if ($canAccept) {
?>
<div class="btn-group btn-group-justified">
<a href="<?php echo getHomePageURL(); ?>" class="btn btn-danger">
<i class="fas fa-times-circle"></i> <?php echo __("Cancel"); ?>
</a>
<a href="<?php echo $_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], "?") === false ? "?" : "&"; ?>rrating=1" class="btn btn-success">
<i class="fas fa-check-circle"></i> <?php echo __("Confirm"); ?>
</a>
</div>
<?php
}
?>
</div>
</div>
</div>
<?php
$_page->print();
?>

View file

@ -0,0 +1,3 @@
ALTER TABLE `users` ADD COLUMN `birth_date` DATE NULL DEFAULT NULL;
UPDATE configurations SET version = '14.2', modified = now() WHERE id = 1;

View file

@ -2704,7 +2704,7 @@ function isUserOnline(users_id) {
} }
function isReadyToCheckIfIsOnline() { function isReadyToCheckIfIsOnline() {
return !empty(users_id_online); return typeof users_id_online !== 'undefined' && !empty(users_id_online);
} }
var addAtMentionActive = false; var addAtMentionActive = false;

View file

@ -105,27 +105,58 @@ foreach ($userGroups as $value) {
<div class="modal-body"> <div class="modal-body">
<form class="form-compact" id="updateUserForm" onsubmit=""> <form class="form-compact" id="updateUserForm" onsubmit="">
<input type="hidden" id="inputUserId"> <input type="hidden" id="inputUserId">
<label for="inputUser" class="sr-only"><?php echo __("User"); ?></label> <div class="row">
<input type="text" id="inputUser" class="form-control first" placeholder="<?php echo __("User"); ?>" autofocus required="required" data-toggle="tooltip" title="<?php echo __('User'); ?>"> <div class="col-sm-6">
<?php <label for="inputUser"><?php echo __("User"); ?></label>
getInputPassword("inputPassword", 'class="form-control" required="required" autocomplete="off"', __("Password")); <input type="text" id="inputUser" class="form-control first" placeholder="<?php echo __("User"); ?>" autofocus required="required" data-toggle="tooltip" title="<?php echo __('User'); ?>">
?> </div>
<label for="inputEmail" class="sr-only"><?php echo __("E-mail"); ?></label> <div class="col-sm-6">
<input type="email" id="inputEmail" class="form-control" placeholder="<?php echo __("E-mail"); ?>" data-toggle="tooltip" title="<?php echo __('E-mail'); ?>"> <label for="inputPassword"><?php echo __("Password"); ?></label><?php
<label for="inputName" class="sr-only"><?php echo __("Name"); ?></label> getInputPassword("inputPassword", 'class="form-control" required="required" autocomplete="off"', __("Password"));
<input type="text" id="inputName" class="form-control " placeholder="<?php echo __("Name"); ?>" data-toggle="tooltip" title="<?php echo __('Name'); ?>"> ?>
<label for="inputChannelName" class="sr-only"><?php echo __("Channel Name"); ?></label> </div>
<input type="text" id="inputChannelName" class="form-control" placeholder="<?php echo __("Channel Name"); ?>" data-toggle="tooltip" title="<?php echo __('Channel Name'); ?>"> <div class="col-sm-6">
<label for="inputPhone" class="sr-only"><?php echo __("Phone"); ?></label> <label for="inputName">
<input type="text" id="inputPhone" class="form-control" placeholder="<?php echo __("Phone"); ?>" data-toggle="tooltip" title="<?php echo __('Phone'); ?>"> <?php echo __("Name"); ?>
<label for="inputAnalyticsCode" class="sr-only"><?php echo __("Analytics Code"); ?></label> </label>
<input type="text" id="inputAnalyticsCode" class="form-control last" placeholder="Google Analytics Code: UA-123456789-1" data-toggle="tooltip" title="<?php echo __('Analytics Code'); ?>"> <input type="text" id="inputName" class="form-control " placeholder="<?php echo __("Name"); ?>" data-toggle="tooltip" title="<?php echo __('Name'); ?>">
<small>Do not paste the full javascript code, paste only the gtag id</small> </div>
<br> <div class="col-sm-6">
<label for="inputEmail">
<?php echo __("E-mail"); ?>
</label>
<input type="email" id="inputEmail" class="form-control" placeholder="<?php echo __("E-mail"); ?>" data-toggle="tooltip" title="<?php echo __('E-mail'); ?>">
</div>
<div class="col-sm-6">
<label for="inputChannelName">
<?php echo __("Channel Name"); ?>
</label>
<input type="text" id="inputChannelName" class="form-control" placeholder="<?php echo __("Channel Name"); ?>" data-toggle="tooltip" title="<?php echo __('Channel Name'); ?>">
</div>
<div class="col-sm-6">
<label for="inputBirth">
<?php echo __("Birth"); ?>
</label>
<input type="date" id="inputBirth" class="form-control" placeholder="<?php echo __("Birth"); ?>" data-toggle="tooltip" title="<?php echo __('Birth'); ?>">
</div>
<div class="col-sm-6">
<label for="inputPhone">
<?php echo __("Phone"); ?>
</label>
<input type="text" id="inputPhone" class="form-control" placeholder="<?php echo __("Phone"); ?>" data-toggle="tooltip" title="<?php echo __('Phone'); ?>">
</div>
<div class="col-sm-6">
<label for="inputAnalyticsCode">
<?php echo __("Analytics Code"); ?>
</label>
<input type="text" id="inputAnalyticsCode" class="form-control last" placeholder="Google Analytics Code: UA-123456789-1" data-toggle="tooltip" title="<?php echo __('Analytics Code'); ?>">
<small>Do not paste the full javascript code, paste only the gtag id</small>
</div>
</div>
<?php <?php
if (empty($advancedCustomUser->disableCompanySignUp) || !empty($advancedCustomUser->enableAffiliation)) { if (empty($advancedCustomUser->disableCompanySignUp) || !empty($advancedCustomUser->enableAffiliation)) {
?> ?>
<label for="is_company" class="sr-only"><?php echo __("is a Company"); ?></label> <label for="is_company"><?php echo __("is a Company"); ?></label>
<select name="is_company" id="is_company" class="form-control last"> <select name="is_company" id="is_company" class="form-control last">
<?php <?php
foreach (User::$is_company_status as $key => $value) { foreach (User::$is_company_status as $key => $value) {
@ -337,6 +368,7 @@ foreach ($userGroups as $value) {
$('#inputName').val(''); $('#inputName').val('');
$('#inputChannelName').val(''); $('#inputChannelName').val('');
$('#inputPhone').val(''); $('#inputPhone').val('');
$('#inputBirth').val('');
$('#inputAnalyticsCode').val(''); $('#inputAnalyticsCode').val('');
$('#is_company').val(0); $('#is_company').val(0);
$('#isAdmin').prop('checked', false); $('#isAdmin').prop('checked', false);
@ -379,6 +411,7 @@ foreach ($userGroups as $value) {
"email": $('#inputEmail').val(), "email": $('#inputEmail').val(),
"name": $('#inputName').val(), "name": $('#inputName').val(),
"phone": $('#inputPhone').val(), "phone": $('#inputPhone').val(),
"birth": $('#inputBirth').val(),
"channelName": $('#inputChannelName').val(), "channelName": $('#inputChannelName').val(),
"analyticsCode": $('#inputAnalyticsCode').val(), "analyticsCode": $('#inputAnalyticsCode').val(),
"isAdmin": $('#isAdmin').is(':checked'), "isAdmin": $('#isAdmin').is(':checked'),
@ -489,6 +522,7 @@ foreach ($userGroups as $value) {
$('#inputName').val(row.name); $('#inputName').val(row.name);
$('#inputChannelName').val(row.channelName); $('#inputChannelName').val(row.channelName);
$('#inputPhone').val(row.phone); $('#inputPhone').val(row.phone);
$('#inputBirth').val(row.birth_date);
$('#inputAnalyticsCode').val(row.analyticsCode); $('#inputAnalyticsCode').val(row.analyticsCode);
$('.userGroups').prop('checked', false); $('.userGroups').prop('checked', false);
$('.usergroupsLi').removeClass('dynamic'); $('.usergroupsLi').removeClass('dynamic');

View file

@ -33,6 +33,24 @@
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("New Password"); ?></label>
<div class="col-md-8 inputGroupContainer">
<?php
getInputPassword("inputPassword", 'class="form-control" autocomplete="off"', __("New Password"));
?>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Confirm New Password"); ?></label>
<div class="col-md-8 inputGroupContainer">
<?php
getInputPassword("inputPasswordConfirm", 'class="form-control" autocomplete="off"', __("Confirm New Password"));
?>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-md-4 control-label"><?php echo __("E-mail"); ?></label> <label class="col-md-4 control-label"><?php echo __("E-mail"); ?></label>
<div class="col-md-6 inputGroupContainer"> <div class="col-md-6 inputGroupContainer">
@ -95,22 +113,13 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-4 control-label"><?php echo __("New Password"); ?></label> <label class="col-md-4 control-label"><?php echo __("Birth"); ?></label>
<div class="col-md-8 inputGroupContainer"> <div class="col-md-8 inputGroupContainer">
<?php <div class="input-group">
getInputPassword("inputPassword", 'class="form-control" autocomplete="off"', __("New Password")); <span class="input-group-addon"><i class="fa-solid fa-cake-candles"></i></span>
?> <input id="inputBirth" placeholder="<?php echo __("Birth"); ?>" class="form-control" type="date" value="<?php echo $user->getBirth_date(); ?>">
</div> </div>
</div>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("Confirm New Password"); ?></label>
<div class="col-md-8 inputGroupContainer">
<?php
getInputPassword("inputPasswordConfirm", 'class="form-control" autocomplete="off"', __("Confirm New Password"));
?>
</div> </div>
</div> </div>
@ -234,6 +243,7 @@
"pass": $('#inputPassword').val(), "pass": $('#inputPassword').val(),
"email": $('#inputEmail').val(), "email": $('#inputEmail').val(),
"phone": $('#phone').val(), "phone": $('#phone').val(),
"birth_date": $('#inputBirth').val(),
"name": $('#inputName').val(), "name": $('#inputName').val(),
"about": content, "about": content,
"channelName": $('#channelName').val(), "channelName": $('#channelName').val(),