From 810121c232ed88243d417c25529cf537bf287155 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Thu, 16 Dec 2021 20:23:25 +0100 Subject: [PATCH 1/3] 2.20.1 --- README.md | 2 +- conf/app.src | 4 ++-- manifest.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ec22c15..531af39 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to ## Overview Dotclear is an open-source web publishing software. -**Shipped version:** 2.19 +**Shipped version:** 2.20.1 ## Screenshots diff --git a/conf/app.src b/conf/app.src index 251b179..0aff2cf 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=http://download.dotclear.org/latest/dotclear-2.19.zip -SOURCE_SUM=51c36592a432d9290dae3da7b01b1f6a9ac2a693b3e05db84be452313417c3f6 +SOURCE_URL=http://download.dotclear.org/latest/dotclear-2.20.1.zip +SOURCE_SUM=fdd919ac1d1499987bb6707a585f9e5eae34d3cdf9f62db9852ea9cd6f8e17a9 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 55aae2e..1ef5656 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Blog publishing application", "fr": "Moteur de blog" }, - "version": "2.19~ynh3", + "version": "2.20.1~ynh1", "license": "GPL-2.0-or-later", "url": "https://dotclear.org/", "maintainer": { From f6cb024d2451d24d8138bfa9c135e81c664f1f1f Mon Sep 17 00:00:00 2001 From: Kay0u Date: Thu, 16 Dec 2021 22:01:27 +0100 Subject: [PATCH 2/3] add a try catch block, improve the ldap auth class --- conf/class.auth.ldap.php | 93 ++++++++++++++++++++++------------------ 1 file changed, 51 insertions(+), 42 deletions(-) diff --git a/conf/class.auth.ldap.php b/conf/class.auth.ldap.php index 9b94d1c..0eaeda8 100644 --- a/conf/class.auth.ldap.php +++ b/conf/class.auth.ldap.php @@ -20,7 +20,6 @@ class ldapDcAuth extends dcAuth if ($ds) { ldap_set_option ($ds, LDAP_OPT_PROTOCOL_VERSION, 3); - if (ldap_bind($ds, "uid=".$user_id.",ou=users,".$this->base, $pwd)) { # search the user in ldap, and get infos @@ -30,57 +29,67 @@ class ldapDcAuth extends dcAuth if ($info["count"] == 1) { - $this->con->begin(); - $cur = $this->con->openCursor($this->user_table); - # Store the password - $cur->user_pwd = $pwd; - - # Store informations about the user - $cur->user_id = $user_id; - $cur->user_email = $info[0]['mail'][0]; - $cur->user_name = $info[0]['sn'][0]; - $cur->user_firstname = $info[0]['givenname'][0]; - $cur->user_displayname = $info[0]['cn'][0]; - - # If the user exist, then we just update his password. - if ($this->core->userExists($user_id)) + try { - $this->sudo(array($this->core, 'updUser'), $user_id, $cur); + $this->con->begin(); + $cur = $this->con->openCursor($this->user_table); + # Store the password + $cur->user_pwd = $pwd; + + # Store informations about the user + $cur->user_id = $user_id; + $cur->user_email = $info[0]['mail'][0]; + $cur->user_name = $info[0]['sn'][0]; + $cur->user_firstname = $info[0]['givenname'][0]; + $cur->user_displayname = $info[0]['cn'][0]; + + # If the user exist, then we just update his password. + if ($this->core->userExists($user_id)) + { + $this->sudo(array($this->core, 'updUser'), $user_id, $cur); + } + # If not, we create him. + # In order for him to connect, + # it is necessary to give him at least + # a permission "usage" on the blog "default". + else + { + $cur->user_lang = 'fr'; # Can change this, PR are welcome + $cur->user_tz = 'Europe/Paris'; # Can change this, PR are welcome + $cur->user_default_blog = 'default'; # Can change this, PR are welcome + $this->sudo(array($this->core,'addUser'), $cur); + # Possible roles: + #admin "administrator" + #usage "manage their own entries and comments" + #publish "publish entries and comments" + #delete "delete entries and comments" + #contentadmin "manage all entries and comments" + #categories "manage categories" + #media "manage their own media items" + #media_admin "manage all media items" + #pages "manage pages" + #blogroll "manage blogroll" + $this->sudo(array($this->core, 'setUserBlogPermissions'), $user_id, 'default', array('usage'=>true)); # Can change this, PR are welcome + } + $this->con->commit(); } - # If not, we create him. - # In order for him to connect, - # it is necessary to give him at least - # a permission "usage" on the blog "default". - else + catch (Exception $e) { - $cur->user_lang = 'fr'; # Can change this, PR are welcome - $cur->user_tz = 'Europe/Paris'; # Can change this, PR are welcome - $cur->user_default_blog = 'default'; # Can change this, PR are welcome - $this->sudo(array($this->core,'addUser'), $cur); - # Possible roles: - #admin "administrator" - #usage "manage their own entries and comments" - #publish "publish entries and comments" - #delete "delete entries and comments" - #contentadmin "manage all entries and comments" - #categories "manage categories" - #media "manage their own media items" - #media_admin "manage all media items" - #pages "manage pages" - #blogroll "manage blogroll" - $this->sudo(array($this->core, 'setUserBlogPermissions'), $user_id, 'default', array('usage'=>true)); # Can change this, PR are welcome + # In case of error we cancel and return "false" + $this->con->rollback(); + return false; } - $this->con->commit(); - # The previous operations proceeded without error, # we can now call the parent method return parent::checkUser($user_id, $pwd); } } + else + { + error_log("Failed to connect with the user ".$user_id); + } } - # In case of error we cancel and return "false" - $this->con->rollback(); - return false; + return parent::checkUser($user_id, $pwd); } } ?> From b3c60487184fd6599cece581615d4dc12301ec95 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 17 Dec 2021 10:56:08 +0100 Subject: [PATCH 3/3] fix a warning --- scripts/upgrade | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 689feaa..efc421c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -66,9 +66,7 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi -is_public=$(ynh_app_setting_get --app=$app --key=is_public) - -if [ -n "$is_public" ]; then +if [ -n "$(ynh_app_setting_get --app=$app --key=is_public)" ]; then ynh_app_setting_delete --app=$app --key=protected_uris # Removing skipped/unprotected_uris under certain conditions, remove the visitors group added during the migration process of 3.7