|
@@ -216,10 +216,17 @@ function app_passwd($_action, $_data = null) {
|
|
break;
|
|
break;
|
|
case 'get':
|
|
case 'get':
|
|
$app_passwds = array();
|
|
$app_passwds = array();
|
|
- $stmt = $pdo->prepare("SELECT `id`, `name` FROM `app_passwd` WHERE `mailbox` = :username");
|
|
|
|
- $stmt->execute(array(':username' => $username));
|
|
|
|
- $app_passwds = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
|
|
- return $app_passwds;
|
|
|
|
|
|
+ if ($_data['username'] != null) {
|
|
|
|
+ $stmt = $pdo->prepare("SELECT `id`, `name` FROM `app_passwd` WHERE `mailbox` = :username");
|
|
|
|
+ $stmt->execute(array(':username' => $username));
|
|
|
|
+ $app_passwds = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
|
|
+ return $app_passwds;
|
|
|
|
+ } else {
|
|
|
|
+ $stmt = $pdo->prepare("SELECT `id`, `name` FROM `app_passwd`");
|
|
|
|
+ $stmt->execute();
|
|
|
|
+ $app_passwds = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
|
|
+ return $app_passwds;
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case 'details':
|
|
case 'details':
|
|
$app_passwd_data = array();
|
|
$app_passwd_data = array();
|