Updated edit extension, user accounts with optional user description

This commit is contained in:
markseu 2022-04-19 23:11:57 +02:00
parent d0c6106b84
commit fd27fe91ca
4 changed files with 21 additions and 14 deletions

View file

@ -2,7 +2,7 @@
// Edit extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/edit // Edit extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/edit
class YellowEdit { class YellowEdit {
const VERSION = "0.8.57"; const VERSION = "0.8.58";
public $yellow; // access to API public $yellow; // access to API
public $response; // web response public $response; // web response
public $merge; // text merge public $merge; // text merge
@ -23,8 +23,8 @@ class YellowEdit {
$this->yellow->system->setDefault("editUserPasswordMinLength", "8"); $this->yellow->system->setDefault("editUserPasswordMinLength", "8");
$this->yellow->system->setDefault("editUserHashAlgorithm", "bcrypt"); $this->yellow->system->setDefault("editUserHashAlgorithm", "bcrypt");
$this->yellow->system->setDefault("editUserHashCost", "10"); $this->yellow->system->setDefault("editUserHashCost", "10");
$this->yellow->system->setDefault("editUserHome", "/");
$this->yellow->system->setDefault("editUserAccess", "create, edit, delete, restore, upload"); $this->yellow->system->setDefault("editUserAccess", "create, edit, delete, restore, upload");
$this->yellow->system->setDefault("editUserHome", "/");
$this->yellow->system->setDefault("editLoginRestriction", "0"); $this->yellow->system->setDefault("editLoginRestriction", "0");
$this->yellow->system->setDefault("editLoginSessionTimeout", "2592000"); $this->yellow->system->setDefault("editLoginSessionTimeout", "2592000");
$this->yellow->system->setDefault("editBruteForceProtection", "25"); $this->yellow->system->setDefault("editBruteForceProtection", "25");
@ -164,12 +164,14 @@ class YellowEdit {
} }
if ($status=="ok") { if ($status=="ok") {
$name = $this->yellow->system->get("sitename"); $name = $this->yellow->system->get("sitename");
$userLanguage = $this->yellow->system->get("language");
$fileNameUser = $this->yellow->system->get("coreExtensionDirectory").$this->yellow->system->get("coreUserFile"); $fileNameUser = $this->yellow->system->get("coreExtensionDirectory").$this->yellow->system->get("coreUserFile");
$settings = array( $settings = array(
"name" => $name, "name" => $name,
"language" => $this->yellow->system->get("language"), "description" => $this->yellow->language->getText("editUserDescription", $userLanguage),
"home" => $this->yellow->system->get("editUserHome"), "language" => $userLanguage,
"access" => $this->yellow->system->get("editUserAccess"), "access" => $this->yellow->system->get("editUserAccess"),
"home" => $this->yellow->system->get("editUserHome"),
"hash" => $this->response->createHash($password), "hash" => $this->response->createHash($password),
"stamp" => $this->response->createStamp(), "stamp" => $this->response->createStamp(),
"pending" => "none", "pending" => "none",
@ -348,12 +350,14 @@ class YellowEdit {
if ($this->response->status=="ok" && $this->response->isLoginRestriction()) $this->response->status = "next"; if ($this->response->status=="ok" && $this->response->isLoginRestriction()) $this->response->status = "next";
if ($this->response->status=="ok" && $this->isUserAccountTaken($email)) $this->response->status = "next"; if ($this->response->status=="ok" && $this->isUserAccountTaken($email)) $this->response->status = "next";
if ($this->response->status=="ok") { if ($this->response->status=="ok") {
$userLanguage = $this->yellow->lookup->findContentLanguage($fileName, $this->yellow->system->get("language"));
$fileNameUser = $this->yellow->system->get("coreExtensionDirectory").$this->yellow->system->get("coreUserFile"); $fileNameUser = $this->yellow->system->get("coreExtensionDirectory").$this->yellow->system->get("coreUserFile");
$settings = array( $settings = array(
"name" => $name, "name" => $name,
"language" => $this->yellow->lookup->findContentLanguage($fileName, $this->yellow->system->get("language")), "description" => $this->yellow->language->getText("editUserDescription", $userLanguage),
"home" => $this->yellow->system->get("editUserHome"), "language" => $userLanguage,
"access" => $this->yellow->system->get("editUserAccess"), "access" => $this->yellow->system->get("editUserAccess"),
"home" => $this->yellow->system->get("editUserHome"),
"hash" => $this->response->createHash($password), "hash" => $this->response->createHash($password),
"stamp" => $this->response->createStamp(), "stamp" => $this->response->createStamp(),
"pending" => "none", "pending" => "none",
@ -597,9 +601,10 @@ class YellowEdit {
$fileNameUser = $this->yellow->system->get("coreExtensionDirectory").$this->yellow->system->get("coreUserFile"); $fileNameUser = $this->yellow->system->get("coreExtensionDirectory").$this->yellow->system->get("coreUserFile");
$settings = array( $settings = array(
"name" => $name, "name" => $name,
"description" => $this->yellow->user->getUser("description", $emailSource),
"language" => $language, "language" => $language,
"home" => $this->yellow->user->getUser("home", $emailSource),
"access" => $this->yellow->user->getUser("access", $emailSource), "access" => $this->yellow->user->getUser("access", $emailSource),
"home" => $this->yellow->user->getUser("home", $emailSource),
"hash" => $this->response->createHash("none"), "hash" => $this->response->createHash("none"),
"stamp" => $this->response->createStamp(), "stamp" => $this->response->createStamp(),
"pending" => $emailSource, "pending" => $emailSource,
@ -1257,10 +1262,11 @@ class YellowEditResponse {
if ($this->isUser()) { if ($this->isUser()) {
$data["email"] = $this->userEmail; $data["email"] = $this->userEmail;
$data["name"] = $this->yellow->user->getUser("name", $this->userEmail); $data["name"] = $this->yellow->user->getUser("name", $this->userEmail);
$data["description"] = $this->yellow->user->getUser("description", $this->userEmail);
$data["language"] = $this->yellow->user->getUser("language", $this->userEmail); $data["language"] = $this->yellow->user->getUser("language", $this->userEmail);
$data["status"] = $this->yellow->user->getUser("status", $this->userEmail); $data["status"] = $this->yellow->user->getUser("status", $this->userEmail);
$data["home"] = $this->yellow->user->getUser("home", $this->userEmail);
$data["access"] = $this->yellow->user->getUser("access", $this->userEmail); $data["access"] = $this->yellow->user->getUser("access", $this->userEmail);
$data["home"] = $this->yellow->user->getUser("home", $this->userEmail);
} }
return $data; return $data;
} }

View file

@ -2,7 +2,7 @@
// Install extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/install // Install extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/install
class YellowInstall { class YellowInstall {
const VERSION = "0.8.69"; const VERSION = "0.8.70";
const PRIORITY = "1"; const PRIORITY = "1";
public $yellow; // access to API public $yellow; // access to API
@ -186,9 +186,10 @@ class YellowInstall {
$fileNameUser = $this->yellow->system->get("coreExtensionDirectory").$this->yellow->system->get("coreUserFile"); $fileNameUser = $this->yellow->system->get("coreExtensionDirectory").$this->yellow->system->get("coreUserFile");
$settings = array( $settings = array(
"name" => $name, "name" => $name,
"description" => $this->yellow->language->getText("editUserDescription", $language),
"language" => $language, "language" => $language,
"home" => "/",
"access" => "create, edit, delete, restore, upload, configure, update", "access" => "create, edit, delete, restore, upload, configure, update",
"home" => "/",
"hash" => $this->yellow->extension->get("edit")->response->createHash($password), "hash" => $this->yellow->extension->get("edit")->response->createHash($password),
"stamp" => $this->yellow->extension->get("edit")->response->createStamp(), "stamp" => $this->yellow->extension->get("edit")->response->createStamp(),
"pending" => "none", "pending" => "none",

View file

@ -37,11 +37,11 @@ system/layouts/navigation.html: navigation.html, create, update, careful
system/layouts/pagination.html: pagination.html, create, update, careful system/layouts/pagination.html: pagination.html, create, update, careful
Extension: Edit Extension: Edit
Version: 0.8.57 Version: 0.8.58
Description: Edit your website in a web browser. Description: Edit your website in a web browser.
DocumentationUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/edit DocumentationUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/edit
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/edit.zip DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/edit.zip
Published: 2022-04-18 23:11:04 Published: 2022-04-19 22:33:56
Developer: Datenstrom Developer: Datenstrom
Tag: feature Tag: feature
system/extensions/edit.php: edit.php, create, update system/extensions/edit.php: edit.php, create, update
@ -64,11 +64,11 @@ media/images/photo.jpg: photo.jpg, create, optional
media/thumbnails/photo-100x40.jpg: photo-100x40.jpg, create, optional media/thumbnails/photo-100x40.jpg: photo-100x40.jpg, create, optional
Extension: Install Extension: Install
Version: 0.8.69 Version: 0.8.70
Description: Install a brand new, shiny website. Description: Install a brand new, shiny website.
DocumentationUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/install DocumentationUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/install
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/install.zip DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/install.zip
Published: 2022-04-18 23:25:29 Published: 2022-04-19 22:49:34
Developer: Datenstrom Developer: Datenstrom
Status: unlisted Status: unlisted
system/extensions/install.php: install.php, create system/extensions/install.php: install.php, create