mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
Version 11.6 Add phone to sign-up screen
This commit is contained in:
parent
176ed7fc02
commit
6727623b0a
13 changed files with 229 additions and 144 deletions
|
@ -4,7 +4,7 @@ if (file_exists("../videos/configuration.php")) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$installationVersion = "11.5";
|
$installationVersion = "11.6";
|
||||||
|
|
||||||
error_log("Installation: ".__LINE__." ". json_encode($_POST));
|
error_log("Installation: ".__LINE__." ". json_encode($_POST));
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
|
|
|
@ -39,6 +39,7 @@ CREATE TABLE IF NOT EXISTS `users` (
|
||||||
`city` VARCHAR(100) NULL DEFAULT NULL,
|
`city` VARCHAR(100) NULL DEFAULT NULL,
|
||||||
`donationLink` VARCHAR(225) NULL DEFAULT NULL,
|
`donationLink` VARCHAR(225) NULL DEFAULT NULL,
|
||||||
`extra_info` TEXT NULL DEFAULT NULL,
|
`extra_info` TEXT NULL DEFAULT NULL,
|
||||||
|
`phone` VARCHAR(255) 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;
|
||||||
|
|
44
objects/uploadUserPhoto.json.php
Normal file
44
objects/uploadUserPhoto.json.php
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
global $global, $config;
|
||||||
|
if (!isset($global['systemRootPath'])) {
|
||||||
|
require_once '../videos/configuration.php';
|
||||||
|
}
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
|
||||||
|
$obj = new stdClass();
|
||||||
|
$obj->error = true;
|
||||||
|
if (!User::isLogged()) {
|
||||||
|
$obj->msg = 'You can\'t edit this file';
|
||||||
|
die(json_encode($obj));
|
||||||
|
}
|
||||||
|
|
||||||
|
$users_id = User::getId();
|
||||||
|
|
||||||
|
$imagePath = "videos/userPhoto/";
|
||||||
|
//Check write Access to Directory
|
||||||
|
$dirPath = $global['systemRootPath'] . $imagePath;
|
||||||
|
|
||||||
|
make_path($dirPath);
|
||||||
|
|
||||||
|
|
||||||
|
$fileName = 'photo' . User::getId() . '.png';
|
||||||
|
$photoURL = $imagePath . $fileName;
|
||||||
|
$photoFullPath = $dirPath . $fileName;
|
||||||
|
$obj->url = $photoURL;
|
||||||
|
|
||||||
|
|
||||||
|
$obj->imagePNGResponse = saveCroppieImage($photoFullPath, "image");
|
||||||
|
if ($obj->imagePNGResponse) {
|
||||||
|
$user = new User(User::getId());
|
||||||
|
$user->setPhotoURL($photoURL);
|
||||||
|
if ($user->save()) {
|
||||||
|
User::deleteOGImage(User::getId());
|
||||||
|
User::updateSessionInfo();
|
||||||
|
clearCache(true);
|
||||||
|
$obj->error = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
die(json_encode($obj));
|
||||||
|
|
|
@ -40,6 +40,7 @@ class User {
|
||||||
private $donationLink;
|
private $donationLink;
|
||||||
private $modified;
|
private $modified;
|
||||||
private $extra_info;
|
private $extra_info;
|
||||||
|
private $phone;
|
||||||
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';
|
||||||
|
@ -67,6 +68,14 @@ class User {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getPhone() {
|
||||||
|
return $this->phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setPhone($phone): void {
|
||||||
|
$this->phone = $phone;
|
||||||
|
}
|
||||||
|
|
||||||
public function getEmail() {
|
public function getEmail() {
|
||||||
return $this->email;
|
return $this->email;
|
||||||
}
|
}
|
||||||
|
@ -631,7 +640,7 @@ if (typeof gtag !== \"function\") {
|
||||||
$values[] = $this->canViewChart;
|
$values[] = $this->canViewChart;
|
||||||
$sql .= "canViewChart = ?, ";
|
$sql .= "canViewChart = ?, ";
|
||||||
}
|
}
|
||||||
$formats .= "ssssssissssssssssi";
|
$formats .= "ssssssisssssssssssi";
|
||||||
$values[] = $this->status;
|
$values[] = $this->status;
|
||||||
$values[] = $this->photoURL;
|
$values[] = $this->photoURL;
|
||||||
$values[] = $this->backgroundURL;
|
$values[] = $this->backgroundURL;
|
||||||
|
@ -649,21 +658,22 @@ if (typeof gtag !== \"function\") {
|
||||||
$values[] = $this->region;
|
$values[] = $this->region;
|
||||||
$values[] = $this->city;
|
$values[] = $this->city;
|
||||||
$values[] = $this->donationLink;
|
$values[] = $this->donationLink;
|
||||||
|
$values[] = $this->phone;
|
||||||
$values[] = $this->id;
|
$values[] = $this->id;
|
||||||
|
|
||||||
$sql .= "status = ?, "
|
$sql .= "status = ?, "
|
||||||
. "photoURL = ?, backgroundURL = ?, "
|
. "photoURL = ?, backgroundURL = ?, "
|
||||||
. "recoverPass = ?, about = ?, "
|
. "recoverPass = ?, about = ?, "
|
||||||
. " channelName = ?, emailVerified = ? , analyticsCode = ?, externalOptions = ? , "
|
. " channelName = ?, emailVerified = ? , analyticsCode = ?, externalOptions = ? , "
|
||||||
. " first_name = ? , last_name = ? , address = ? , zip_code = ? , country = ? , region = ? , city = ? , donationLink = ? , "
|
. " first_name = ? , last_name = ? , address = ? , zip_code = ? , country = ? , region = ? , city = ? , donationLink = ? , phone = ? , "
|
||||||
. " modified = now() WHERE id = ?";
|
. " modified = now() WHERE id = ?";
|
||||||
} else {
|
} else {
|
||||||
$formats = "ssssiiiissssss";
|
$formats = "ssssiiiisssssss";
|
||||||
$values = [$user, $password, $this->email, $name, $this->isAdmin, $this->canStream, $this->canUpload, $this->canCreateMeet,
|
$values = [$user, $password, $this->email, $name, $this->isAdmin, $this->canStream, $this->canUpload, $this->canCreateMeet,
|
||||||
$status, $this->photoURL, $this->recoverPass, $channelName, $this->analyticsCode, $this->externalOptions,];
|
$status, $this->photoURL, $this->recoverPass, $channelName, $this->analyticsCode, $this->externalOptions, $this->phone];
|
||||||
$sql = "INSERT INTO users (user, password, email, name, isAdmin, canStream, canUpload, canCreateMeet, canViewChart, status,photoURL,recoverPass, created, modified, channelName, analyticsCode, externalOptions) "
|
$sql = "INSERT INTO users (user, password, email, name, isAdmin, canStream, canUpload, canCreateMeet, canViewChart, status,photoURL,recoverPass, created, modified, channelName, analyticsCode, externalOptions, phone) "
|
||||||
. " VALUES (?,?,?,?,?,?,?,?, false, "
|
. " VALUES (?,?,?,?,?,?,?,?, false, "
|
||||||
. "?,?,?, now(), now(),?,?,?)";
|
. "?,?,?, now(), now(),?,?,?,?)";
|
||||||
}
|
}
|
||||||
$insert_row = sqlDAL::writeSql($sql, $formats, $values);
|
$insert_row = sqlDAL::writeSql($sql, $formats, $values);
|
||||||
if ($insert_row) {
|
if ($insert_row) {
|
||||||
|
|
|
@ -71,6 +71,7 @@ $user->setUser($_POST['user']);
|
||||||
$user->setPassword($_POST['pass']);
|
$user->setPassword($_POST['pass']);
|
||||||
$user->setEmail($_POST['email']);
|
$user->setEmail($_POST['email']);
|
||||||
$user->setName($_POST['name']);
|
$user->setName($_POST['name']);
|
||||||
|
$user->setPhone(@$_POST['phone']);
|
||||||
|
|
||||||
$user->setCanUpload($config->getAuthCanUploadVideos());
|
$user->setCanUpload($config->getAuthCanUploadVideos());
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,12 @@ if (!isset($global['systemRootPath'])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$obj = new stdClass();
|
$obj = new stdClass();
|
||||||
|
$obj->error = true;
|
||||||
|
$obj->msg = '';
|
||||||
|
$obj->users_id = 0;
|
||||||
|
|
||||||
if (!User::isLogged()) {
|
if (!User::isLogged()) {
|
||||||
$obj->error = __("Is not logged");
|
$obj->msg = __("Is not logged");
|
||||||
die(json_encode($obj));
|
die(json_encode($obj));
|
||||||
}
|
}
|
||||||
$_REQUEST["do_not_login"]=1;
|
$_REQUEST["do_not_login"]=1;
|
||||||
|
@ -22,25 +25,26 @@ $user->setName($_POST['name']);
|
||||||
$user->setAbout($_POST['about']);
|
$user->setAbout($_POST['about']);
|
||||||
$user->setAnalyticsCode($_POST['analyticsCode']);
|
$user->setAnalyticsCode($_POST['analyticsCode']);
|
||||||
$user->setDonationLink($_POST['donationLink']);
|
$user->setDonationLink($_POST['donationLink']);
|
||||||
|
$user->setPhone($_POST['phone']);
|
||||||
$unique = $user->setChannelName($_POST['channelName']);
|
$unique = $user->setChannelName($_POST['channelName']);
|
||||||
if (!$unique) {
|
if (!$unique) {
|
||||||
$obj->error = __("Channel name already exists");
|
$obj->msg = __("Channel name already exists");
|
||||||
die(json_encode($obj));
|
die(json_encode($obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($user->getBdId())) {
|
if (empty($user->getBdId())) {
|
||||||
$obj->error = __("User not found");
|
$obj->msg = __("User not found");
|
||||||
die(json_encode($obj));
|
die(json_encode($obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($advancedCustomUser->emailMustBeUnique)) {
|
if (!empty($advancedCustomUser->emailMustBeUnique)) {
|
||||||
if (empty($_POST['email']) || !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
|
if (empty($_POST['email']) || !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
|
||||||
$obj->error = __("You must specify a valid email")." {$_POST['email']} (update)";
|
$obj->msg = __("You must specify a valid email")." {$_POST['email']} (update)";
|
||||||
die(json_encode($obj));
|
die(json_encode($obj));
|
||||||
}
|
}
|
||||||
$userFromEmail = User::getUserFromEmail($_POST['email']);
|
$userFromEmail = User::getUserFromEmail($_POST['email']);
|
||||||
if (!empty($userFromEmail) && $userFromEmail['id'] !== $user->getBdId()) {
|
if (!empty($userFromEmail) && $userFromEmail['id'] !== $user->getBdId()) {
|
||||||
$obj->error = __("Email already exists");
|
$obj->msg = __("Email already exists");
|
||||||
die(json_encode($obj));
|
die(json_encode($obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,5 +52,9 @@ if (!empty($advancedCustomUser->emailMustBeUnique)) {
|
||||||
if (User::isAdmin() && !empty($_POST['status'])) {
|
if (User::isAdmin() && !empty($_POST['status'])) {
|
||||||
$user->setStatus($_POST['status']);
|
$user->setStatus($_POST['status']);
|
||||||
}
|
}
|
||||||
echo '{"status":"' . $user->save() . '"}';
|
|
||||||
|
$obj->users_id = $user->save();
|
||||||
|
|
||||||
|
$obj->error = empty($obj->users_id);
|
||||||
User::updateSessionInfo();
|
User::updateSessionInfo();
|
||||||
|
die(json_encode($obj));
|
|
@ -156,6 +156,9 @@ class CustomizeUser extends PluginAbstract
|
||||||
$obj->videosSearchAlsoSearchesOnChannelName = false;
|
$obj->videosSearchAlsoSearchesOnChannelName = false;
|
||||||
self::addDataObjectHelper('videosSearchAlsoSearchesOnChannelName', 'Videos search also searches on ChannelName', 'With this checked when you searc a video we will also return the results that matches with the channel name');
|
self::addDataObjectHelper('videosSearchAlsoSearchesOnChannelName', 'Videos search also searches on ChannelName', 'With this checked when you searc a video we will also return the results that matches with the channel name');
|
||||||
|
|
||||||
|
$obj->doNotShowPhoneMyAccount = true;
|
||||||
|
$obj->doNotShowPhoneOnSignup = true;
|
||||||
|
|
||||||
return $obj;
|
return $obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,19 @@ require_once dirname(__FILE__) . '/../../videos/configuration.php';
|
||||||
|
|
||||||
allowOrigin();
|
allowOrigin();
|
||||||
$obj = AVideoPlugin::getObjectData("MobileManager");
|
$obj = AVideoPlugin::getObjectData("MobileManager");
|
||||||
|
|
||||||
|
$customizeUser = AVideoPlugin::getDataObject('CustomizeUser');
|
||||||
|
$obj->doNotShowPhoneOnSignup = $customizeUser->doNotShowPhoneOnSignup;
|
||||||
|
|
||||||
|
$chat2 = AVideoPlugin::getDataObjectIfEnabled('Chat2');
|
||||||
|
if(!empty($chat2)){
|
||||||
|
$obj->chat2ShowOnLive = $chat2->showOnLive;
|
||||||
|
$obj->chat2ShowOnUserVideos = $chat2->showOnUserVideos;
|
||||||
|
}else{
|
||||||
|
$obj->chat2ShowOnLive = false;
|
||||||
|
$obj->chat2ShowOnUserVideos = false;
|
||||||
|
}
|
||||||
|
|
||||||
$obj->EULA = nl2br($obj->EULA->value);
|
$obj->EULA = nl2br($obj->EULA->value);
|
||||||
$obj->YPTSocket = AVideoPlugin::getDataObjectIfEnabled('YPTSocket');
|
$obj->YPTSocket = AVideoPlugin::getDataObjectIfEnabled('YPTSocket');
|
||||||
$obj->language = $config->getLanguage();
|
$obj->language = $config->getLanguage();
|
||||||
|
|
13
updatedb/updateDb.v11.6.sql
Normal file
13
updatedb/updateDb.v11.6.sql
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
|
||||||
|
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
|
||||||
|
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
|
||||||
|
|
||||||
|
ALTER TABLE `users`
|
||||||
|
ADD COLUMN `phone` VARCHAR(255) NULL DEFAULT NULL;
|
||||||
|
|
||||||
|
|
||||||
|
SET SQL_MODE=@OLD_SQL_MODE;
|
||||||
|
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
|
||||||
|
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
|
||||||
|
|
||||||
|
UPDATE configurations SET version = '11.6', modified = now() WHERE id = 1;
|
|
@ -81,7 +81,8 @@
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
foreach ($userGroups as $value) {
|
foreach ($userGroups as $value) {
|
||||||
$gridID = "userGroupGrid{$value['id']}"; ?>
|
$gridID = "userGroupGrid{$value['id']}";
|
||||||
|
?>
|
||||||
<div id="userGroupTab<?php echo $value['id']; ?>" class="tab-pane fade">
|
<div id="userGroupTab<?php echo $value['id']; ?>" class="tab-pane fade">
|
||||||
<div class="btn-group pull-left" id="filterButtonsUG<?php echo $value['id']; ?>">
|
<div class="btn-group pull-left" id="filterButtonsUG<?php echo $value['id']; ?>">
|
||||||
<div class="btn-group ">
|
<div class="btn-group ">
|
||||||
|
@ -136,6 +137,13 @@
|
||||||
<input type="email" id="inputEmail" class="form-control" placeholder="<?php echo __("E-mail"); ?>" >
|
<input type="email" id="inputEmail" class="form-control" placeholder="<?php echo __("E-mail"); ?>" >
|
||||||
<label for="inputName" class="sr-only"><?php echo __("Name"); ?></label>
|
<label for="inputName" class="sr-only"><?php echo __("Name"); ?></label>
|
||||||
<input type="text" id="inputName" class="form-control " placeholder="<?php echo __("Name"); ?>" >
|
<input type="text" id="inputName" class="form-control " placeholder="<?php echo __("Name"); ?>" >
|
||||||
|
<?php
|
||||||
|
if (empty($advancedCustomUser->doNotShowPhoneOnSignup)) {
|
||||||
|
?>
|
||||||
|
<label for="phone" class="sr-only"><?php echo __("Phone"); ?></label>
|
||||||
|
<input type="text" id="phone" class="form-control " placeholder="<?php echo __("Phone"); ?>" >
|
||||||
|
<?php }
|
||||||
|
?>
|
||||||
<label for="inputChannelName" class="sr-only"><?php echo __("Channel Name"); ?></label>
|
<label for="inputChannelName" class="sr-only"><?php echo __("Channel Name"); ?></label>
|
||||||
<input type="text" id="inputChannelName" class="form-control" placeholder="<?php echo __("Channel Name"); ?>" >
|
<input type="text" id="inputChannelName" class="form-control" placeholder="<?php echo __("Channel Name"); ?>" >
|
||||||
<label for="inputAnalyticsCode" class="sr-only"><?php echo __("Analytics Code"); ?></label>
|
<label for="inputAnalyticsCode" class="sr-only"><?php echo __("Analytics Code"); ?></label>
|
||||||
|
@ -143,49 +151,49 @@
|
||||||
<small>Do not paste the full javascript code, paste only the gtag id</small>
|
<small>Do not paste the full javascript code, paste only the gtag id</small>
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
<li class="list-group-item <?php echo User::isAdmin() ? "" : "hidden"; ?>">
|
<li class="list-group-item <?php echo User::isAdmin() ? "" : "hidden"; ?>">
|
||||||
<?php echo __("is Admin"); ?>
|
<?php echo __("is Admin"); ?>
|
||||||
<div class="material-switch pull-right">
|
<div class="material-switch pull-right">
|
||||||
<input type="checkbox" value="isAdmin" id="isAdmin"/>
|
<input type="checkbox" value="isAdmin" id="isAdmin"/>
|
||||||
<label for="isAdmin" class="label-success"></label>
|
<label for="isAdmin" class="label-success"></label>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<?php echo __("Can Stream Videos"); ?>
|
<?php echo __("Can Stream Videos"); ?>
|
||||||
<div class="material-switch pull-right">
|
<div class="material-switch pull-right">
|
||||||
<input type="checkbox" value="canStream" id="canStream"/>
|
<input type="checkbox" value="canStream" id="canStream"/>
|
||||||
<label for="canStream" class="label-success"></label>
|
<label for="canStream" class="label-success"></label>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<?php echo __("Can Upload Videos"); ?>
|
<?php echo __("Can Upload Videos"); ?>
|
||||||
<div class="material-switch pull-right">
|
<div class="material-switch pull-right">
|
||||||
<input type="checkbox" value="canUpload" id="canUpload"/>
|
<input type="checkbox" value="canUpload" id="canUpload"/>
|
||||||
<label for="canUpload" class="label-success"></label>
|
<label for="canUpload" class="label-success"></label>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<?php echo __("Can view chart"); ?>
|
<?php echo __("Can view chart"); ?>
|
||||||
<div class="material-switch pull-right">
|
<div class="material-switch pull-right">
|
||||||
<input type="checkbox" value="canViewChart" id="canViewChart"/>
|
<input type="checkbox" value="canViewChart" id="canViewChart"/>
|
||||||
<label for="canViewChart" class="label-success"></label>
|
<label for="canViewChart" class="label-success"></label>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<?php echo __("Can create meet"); ?>
|
<?php echo __("Can create meet"); ?>
|
||||||
<div class="material-switch pull-right">
|
<div class="material-switch pull-right">
|
||||||
<input type="checkbox" value="canCreateMeet" id="canCreateMeet"/>
|
<input type="checkbox" value="canCreateMeet" id="canCreateMeet"/>
|
||||||
<label for="canCreateMeet" class="label-success"></label>
|
<label for="canCreateMeet" class="label-success"></label>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<?php echo __("E-mail Verified"); ?>
|
<?php echo __("E-mail Verified"); ?>
|
||||||
<div class="material-switch pull-right">
|
<div class="material-switch pull-right">
|
||||||
<input type="checkbox" value="isEmailVerified" id="isEmailVerified"/>
|
<input type="checkbox" value="isEmailVerified" id="isEmailVerified"/>
|
||||||
<label for="isEmailVerified" class="label-success"></label>
|
<label for="isEmailVerified" class="label-success"></label>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<?php echo __("is Active"); ?>
|
<?php echo __("is Active"); ?>
|
||||||
<div class="material-switch pull-right">
|
<div class="material-switch pull-right">
|
||||||
<input type="checkbox" value="status" id="status"/>
|
<input type="checkbox" value="status" id="status"/>
|
||||||
<label for="status" class="label-success"></label>
|
<label for="status" class="label-success"></label>
|
||||||
|
@ -197,7 +205,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
<li class="list-group-item active">
|
<li class="list-group-item active">
|
||||||
<?php echo __("User Groups"); ?>
|
<?php echo __("User Groups"); ?>
|
||||||
<a href="#" class="btn btn-info btn-xs pull-right" data-toggle="popover" title="<?php echo __("What is User Groups"); ?>" data-placement="bottom" data-content="<?php echo __("By associating groups with this user, they will be able to see all the videos that are related to this group"); ?>"><span class="fa fa-question-circle" aria-hidden="true"></span> <?php echo __("Help"); ?></a>
|
<a href="#" class="btn btn-info btn-xs pull-right" data-toggle="popover" title="<?php echo __("What is User Groups"); ?>" data-placement="bottom" data-content="<?php echo __("By associating groups with this user, they will be able to see all the videos that are related to this group"); ?>"><span class="fa fa-question-circle" aria-hidden="true"></span> <?php echo __("Help"); ?></a>
|
||||||
</li>
|
</li>
|
||||||
<?php
|
<?php
|
||||||
|
@ -205,7 +213,7 @@
|
||||||
?>
|
?>
|
||||||
<li class="list-group-item usergroupsLi" id="usergroupsLi<?php echo $value['id']; ?>">
|
<li class="list-group-item usergroupsLi" id="usergroupsLi<?php echo $value['id']; ?>">
|
||||||
<span class="fa fa-unlock"></span>
|
<span class="fa fa-unlock"></span>
|
||||||
<?php echo $value['group_name']; ?>
|
<?php echo $value['group_name']; ?>
|
||||||
<span class="label label-info"><?php echo $value['total_videos']; ?> <?php echo __("Videos linked"); ?></span>
|
<span class="label label-info"><?php echo $value['total_videos']; ?> <?php echo __("Videos linked"); ?></span>
|
||||||
<span class="label label-warning dynamicLabel"><i class="fas fa-link"></i> <?php echo __("Dynamic group"); ?></span>
|
<span class="label label-warning dynamicLabel"><i class="fas fa-link"></i> <?php echo __("Dynamic group"); ?></span>
|
||||||
<div class="material-switch pull-right">
|
<div class="material-switch pull-right">
|
||||||
|
@ -335,6 +343,7 @@
|
||||||
$('#inputPassword').val('');
|
$('#inputPassword').val('');
|
||||||
$('#inputEmail').val('');
|
$('#inputEmail').val('');
|
||||||
$('#inputName').val('');
|
$('#inputName').val('');
|
||||||
|
$('#phone').val('');
|
||||||
$('#inputChannelName').val('');
|
$('#inputChannelName').val('');
|
||||||
$('#inputAnalyticsCode').val('');
|
$('#inputAnalyticsCode').val('');
|
||||||
$('#isAdmin').prop('checked', false);
|
$('#isAdmin').prop('checked', false);
|
||||||
|
@ -377,6 +386,7 @@ print AVideoPlugin::updateUserFormJS();
|
||||||
"pass": $('#inputPassword').val(),
|
"pass": $('#inputPassword').val(),
|
||||||
"email": $('#inputEmail').val(),
|
"email": $('#inputEmail').val(),
|
||||||
"name": $('#inputName').val(),
|
"name": $('#inputName').val(),
|
||||||
|
"phone": $('#phone').val(),
|
||||||
"channelName": $('#inputChannelName').val(),
|
"channelName": $('#inputChannelName').val(),
|
||||||
"analyticsCode": $('#inputAnalyticsCode').val(),
|
"analyticsCode": $('#inputAnalyticsCode').val(),
|
||||||
"isAdmin": $('#isAdmin').is(':checked'),
|
"isAdmin": $('#isAdmin').is(':checked'),
|
||||||
|
@ -484,6 +494,7 @@ print AVideoPlugin::updateUserFormJS();
|
||||||
$('#inputPassword').val('');
|
$('#inputPassword').val('');
|
||||||
$('#inputEmail').val(row.email);
|
$('#inputEmail').val(row.email);
|
||||||
$('#inputName').val(row.name);
|
$('#inputName').val(row.name);
|
||||||
|
$('#phone').val(row.phone);
|
||||||
$('#inputChannelName').val(row.channelName);
|
$('#inputChannelName').val(row.channelName);
|
||||||
$('#inputAnalyticsCode').val(row.analyticsCode);
|
$('#inputAnalyticsCode').val(row.analyticsCode);
|
||||||
$('.userGroups').prop('checked', false);
|
$('.userGroups').prop('checked', false);
|
||||||
|
@ -492,9 +503,9 @@ print AVideoPlugin::updateUserFormJS();
|
||||||
|
|
||||||
for (var index in row.groups) {
|
for (var index in row.groups) {
|
||||||
$('#userGroup' + row.groups[index].id).prop('checked', true);
|
$('#userGroup' + row.groups[index].id).prop('checked', true);
|
||||||
if(row.groups[index].isDynamic){
|
if (row.groups[index].isDynamic) {
|
||||||
$('#usergroupsLi' + row.groups[index].id).addClass('dynamic');
|
$('#usergroupsLi' + row.groups[index].id).addClass('dynamic');
|
||||||
$('#usergroupsLi' + row.groups[index].id+' input').attr("disabled", true);
|
$('#usergroupsLi' + row.groups[index].id + ' input').attr("disabled", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$('#isAdmin').prop('checked', (row.isAdmin == "1" ? true : false));
|
$('#isAdmin').prop('checked', (row.isAdmin == "1" ? true : false));
|
||||||
|
|
|
@ -83,6 +83,20 @@ if (!empty($_GET['siteRedirectUri'])) {
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
} ?>
|
} ?>
|
||||||
|
<?php
|
||||||
|
if (empty($advancedCustomUser->doNotShowPhoneOnSignup)) {
|
||||||
|
?>
|
||||||
|
<div class="form-group <?php echo getCSSAnimationClassAndStyle(); ?>">
|
||||||
|
<label class="col-sm-4 control-label hidden-xs"><?php echo __("Phone"); ?></label>
|
||||||
|
<div class="col-sm-8 inputGroupContainer">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-addon"><i class="fas fa-phone"></i></span>
|
||||||
|
<input id="phone" placeholder="<?php echo __("Phone"); ?>" class="form-control" type="text" value="" >
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
} ?>
|
||||||
<div class="form-group <?php echo getCSSAnimationClassAndStyle(); ?>">
|
<div class="form-group <?php echo getCSSAnimationClassAndStyle(); ?>">
|
||||||
<label class="col-sm-4 control-label hidden-xs"><?php echo __("New Password"); ?></label>
|
<label class="col-sm-4 control-label hidden-xs"><?php echo __("New Password"); ?></label>
|
||||||
<div class="col-sm-8 inputGroupContainer">
|
<div class="col-sm-8 inputGroupContainer">
|
||||||
|
@ -155,6 +169,7 @@ if (!empty($_GET['siteRedirectUri'])) {
|
||||||
"user": $('#inputUser').val(),
|
"user": $('#inputUser').val(),
|
||||||
"pass": $('#inputPassword').val(),
|
"pass": $('#inputPassword').val(),
|
||||||
"email": $('#inputEmail').val(),
|
"email": $('#inputEmail').val(),
|
||||||
|
"phone": $('#Phone').val(),
|
||||||
"name": $('#inputName').val(),
|
"name": $('#inputName').val(),
|
||||||
"captcha": $('#captchaText').val()
|
"captcha": $('#captchaText').val()
|
||||||
},
|
},
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-4 control-label"><?php echo !empty($advancedCustomUser->forceLoginToBeTheEmail) ? __("E-mail") : __("User"); ?></label>
|
<label class="col-md-4 control-label"><?php echo!empty($advancedCustomUser->forceLoginToBeTheEmail) ? __("E-mail") : __("User"); ?></label>
|
||||||
<div class="col-md-8 inputGroupContainer">
|
<div class="col-md-8 inputGroupContainer">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
|
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
|
||||||
|
@ -81,6 +81,20 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group <?php
|
||||||
|
if (!empty($advancedCustomUser->doNotShowPhone)) {
|
||||||
|
echo " hidden ";
|
||||||
|
}
|
||||||
|
?>">
|
||||||
|
<label class="col-md-4 control-label"><?php echo __("Phone"); ?></label>
|
||||||
|
<div class="col-md-8 inputGroupContainer">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-addon"><i class="fas fa-phone"></i></span>
|
||||||
|
<input id="phone" placeholder="<?php echo __("Phone"); ?>" class="form-control" type="text" value="<?php echo $user->getPhone(); ?>" >
|
||||||
|
</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 __("New Password"); ?></label>
|
||||||
<div class="col-md-8 inputGroupContainer">
|
<div class="col-md-8 inputGroupContainer">
|
||||||
|
@ -161,55 +175,26 @@
|
||||||
?>
|
?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<div class="panel panel-default">
|
<?php
|
||||||
<div class="panel-heading">
|
include $global['systemRootPath'] . 'view/userPhotoUploadInclude.php';
|
||||||
<?php echo __("Profile Photo"); ?><br>
|
?>
|
||||||
<?php
|
|
||||||
if($vloObj = AVideoPlugin::getDataObjectIfEnabled('VideoLogoOverlay')){
|
|
||||||
if($vloObj->useUserChannelImageAsLogo){
|
|
||||||
?>
|
|
||||||
<small><?php echo __("This image will appear in your livestream"); ?></small><br>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
?>
|
|
||||||
<small><?php echo __("You must click save to confirm"); ?></small>
|
|
||||||
</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="col-md-12 ">
|
|
||||||
<div id="croppie"></div>
|
|
||||||
<center>
|
|
||||||
<a id="upload-btn" class="btn btn-primary"><i class="fa fa-upload"></i> <?php echo __("Upload a Photo"); ?></a>
|
|
||||||
</center>
|
|
||||||
<div class="alert alert-info">
|
|
||||||
<?php echo __("Make sure you click on the Save button after change the photo"); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<input type="file" id="upload" value="Choose a file" accept="image/*" style="display: none;" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
<?php
|
<?php
|
||||||
$channelArtRelativePath = User::getBackgroundURLFromUserID(User::getId());
|
$channelArtRelativePath = User::getBackgroundURLFromUserID(User::getId());
|
||||||
|
|
||||||
$finalWidth = 2560;
|
$finalWidth = 2560;
|
||||||
$finalHeight = 1440;
|
$finalHeight = 1440;
|
||||||
if(isMobile()){
|
if (isMobile()) {
|
||||||
$screenWidth = 640;
|
$screenWidth = 640;
|
||||||
$screenHeight = 360;
|
$screenHeight = 360;
|
||||||
}else{
|
} else {
|
||||||
$screenWidth = 960;
|
$screenWidth = 960;
|
||||||
$screenHeight = 540;
|
$screenHeight = 540;
|
||||||
}
|
}
|
||||||
$factorW = $screenWidth / $finalWidth;
|
$factorW = $screenWidth / $finalWidth;
|
||||||
include $global['systemRootPath'] . 'view/userChannelArtUploadInclude.php';
|
include $global['systemRootPath'] . 'view/userChannelArtUploadInclude.php';
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -232,27 +217,6 @@
|
||||||
str = $('#analyticsCode').val();
|
str = $('#analyticsCode').val();
|
||||||
return str === '' || (/^ua-\d{4,9}-\d{1,4}$/i).test(str.toString());
|
return str === '' || (/^ua-\d{4,9}-\d{1,4}$/i).test(str.toString());
|
||||||
}
|
}
|
||||||
function readFile(input, crop) {
|
|
||||||
console.log(input);
|
|
||||||
console.log($(input)[0]);
|
|
||||||
console.log($(input)[0].files);
|
|
||||||
if ($(input)[0].files && $(input)[0].files[0]) {
|
|
||||||
var reader = new FileReader();
|
|
||||||
|
|
||||||
reader.onload = function (e) {
|
|
||||||
crop.croppie('bind', {
|
|
||||||
url: e.target.result
|
|
||||||
}).then(function () {
|
|
||||||
console.log('jQuery bind complete');
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
reader.readAsDataURL($(input)[0].files[0]);
|
|
||||||
} else {
|
|
||||||
avideoAlert("Sorry - you're browser doesn't support the FileReader API");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateUserFormSubmit() {
|
function updateUserFormSubmit() {
|
||||||
|
|
||||||
|
@ -262,6 +226,7 @@
|
||||||
"user": $('#inputUser').val(),
|
"user": $('#inputUser').val(),
|
||||||
"pass": $('#inputPassword').val(),
|
"pass": $('#inputPassword').val(),
|
||||||
"email": $('#inputEmail').val(),
|
"email": $('#inputEmail').val(),
|
||||||
|
"phone": $('#phone').val(),
|
||||||
"name": $('#inputName').val(),
|
"name": $('#inputName').val(),
|
||||||
"about": $('#textAbout').val(),
|
"about": $('#textAbout').val(),
|
||||||
"channelName": $('#channelName').val(),
|
"channelName": $('#channelName').val(),
|
||||||
|
@ -270,67 +235,25 @@
|
||||||
},
|
},
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (response) {
|
success: function (response) {
|
||||||
if (response.status > "0") {
|
avideoResponse(response);
|
||||||
uploadCrop.croppie('result', {
|
modal.hidePleaseWait();
|
||||||
type: 'canvas',
|
|
||||||
size: 'viewport'
|
|
||||||
}).then(function (resp) {
|
|
||||||
console.log("userSavePhoto");
|
|
||||||
$.ajax({
|
|
||||||
type: "POST",
|
|
||||||
url: "<?php echo $global['webSiteRootURL']; ?>objects/userSavePhoto.php",
|
|
||||||
data: {
|
|
||||||
imgBase64: resp,
|
|
||||||
},
|
|
||||||
success: function (response) {
|
|
||||||
modal.hidePleaseWait();
|
|
||||||
avideoResponse(response);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else if (response.error) {
|
|
||||||
avideoAlert("<?php echo __("Sorry!"); ?>", response.error, "error");
|
|
||||||
modal.hidePleaseWait();
|
|
||||||
} else {
|
|
||||||
avideoAlert("<?php echo __("Sorry!"); ?>", "<?php echo __("Your user has NOT been updated!"); ?>", "error");
|
|
||||||
modal.hidePleaseWait();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
$('#upload').on('change', function () {
|
|
||||||
readFile(this, uploadCrop);
|
|
||||||
});
|
|
||||||
$('#upload-btn').on('click', function (ev) {
|
|
||||||
$('#upload').trigger("click");
|
|
||||||
});
|
|
||||||
<?php
|
<?php
|
||||||
if (!empty($advancedCustomUser->forceLoginToBeTheEmail)) {
|
if (!empty($advancedCustomUser->forceLoginToBeTheEmail)) {
|
||||||
?>
|
?>
|
||||||
$('#inputUser').on('keyup', function () {
|
$('#inputUser').on('keyup', function () {
|
||||||
$('#inputEmail').val($(this).val());
|
$('#inputEmail').val($(this).val());
|
||||||
});
|
});
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
uploadCrop = $('#croppie').croppie({
|
|
||||||
url: '<?php echo $user->getPhoto(); ?>',
|
|
||||||
enableExif: true,
|
|
||||||
enforceBoundary: false,
|
|
||||||
mouseWheelZoom: false,
|
|
||||||
viewport: {
|
|
||||||
width: 150,
|
|
||||||
height: 150
|
|
||||||
},
|
|
||||||
boundary: {
|
|
||||||
width: 150,
|
|
||||||
height: 150
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$('#updateUserForm').submit(function (evt) {
|
$('#updateUserForm').submit(function (evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
if (!isAnalytics()) {
|
if (!isAnalytics()) {
|
||||||
|
@ -348,9 +271,7 @@ if (!empty($advancedCustomUser->forceLoginToBeTheEmail)) {
|
||||||
avideoAlert("<?php echo __("Sorry!"); ?>", "<?php echo __("Your password does not match!"); ?>", "error");
|
avideoAlert("<?php echo __("Sorry!"); ?>", "<?php echo __("Your password does not match!"); ?>", "error");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
setTimeout(function () {
|
updateUserFormSubmit();
|
||||||
updateUserFormSubmit();
|
|
||||||
}, 1000);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
45
view/userPhotoUploadInclude.php
Normal file
45
view/userPhotoUploadInclude.php
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
<?php
|
||||||
|
$finalWidth = 150;
|
||||||
|
$finalHeight = 150;
|
||||||
|
$screenWidth = 150;
|
||||||
|
$caUid = 'Photo_' . uniqid();
|
||||||
|
?>
|
||||||
|
<div class="form-group" id="<?php echo $caUid; ?>">
|
||||||
|
<?php
|
||||||
|
$croppie = getCroppie(__('Profile Photo'), 'userPhotoUpload', $finalWidth, $finalHeight, $screenWidth);
|
||||||
|
echo $croppie['html'];
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<button class="btn btn-success btn-block" type="button" onclick="<?php echo $croppie['getCroppieFunction']; ?>"><i class="fas fa-save"></i> <?php echo __('Save Profile Photo'); ?></button>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
if ($vloObj = AVideoPlugin::getDataObjectIfEnabled('VideoLogoOverlay')) {
|
||||||
|
if ($vloObj->useUserChannelImageAsLogo) {
|
||||||
|
?>
|
||||||
|
<div class="alert alert-info"><?php echo __("This image will appear in your livestream"); ?></div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
<?php
|
||||||
|
echo $croppie['restartCroppie'] . "('" . User::getPhoto() . "');";
|
||||||
|
?>
|
||||||
|
});
|
||||||
|
function userPhotoUpload(image) {
|
||||||
|
modal.showPleaseWait();
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo $global['webSiteRootURL'] . "objects/uploadUserPhoto.json.php"; ?>',
|
||||||
|
data: {
|
||||||
|
image: image
|
||||||
|
},
|
||||||
|
type: 'post',
|
||||||
|
success: function (response) {
|
||||||
|
avideoResponse(response);
|
||||||
|
modal.hidePleaseWait();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
Loading…
Add table
Add a link
Reference in a new issue