From 5b06e24265ca9dfcb9ced320b8f78716372fcc56 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 26 Nov 2012 04:27:19 -0500
Subject: [PATCH] Cleaner way of handling user password in framework-based programs with no session
---
program/lib/Roundcube/rcube.php | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php
index 27e10a9..c798465 100644
--- a/program/lib/Roundcube/rcube.php
+++ b/program/lib/Roundcube/rcube.php
@@ -1220,6 +1220,22 @@
return $this->user->get_username('mail');
}
}
+
+
+ /**
+ * Getter for logged user password.
+ *
+ * @return string User password
+ */
+ public function get_user_password()
+ {
+ if ($this->password) {
+ return $this->password;
+ }
+ else if ($_SESSION['password']) {
+ return $this->decrypt($_SESSION['password']);
+ }
+ }
}
--
Gitblit v1.9.1