public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
PHP
49%
JavaScript
35%
HTML
9%
CSS
4%
Shell
2%
Python
1%
Lua
0%
Perl
0%
Ruby
0%
SCSS
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git
Commit
Revert "Add app-passwd list (#4281) (#4311)" (#4318)
This reverts commit 8dad04e0e65d25cba527c7ea737fcdd1c5b6af37.
f4319a0e
data/web/api/openapi.yaml | 33 -------------------------------
data/web/inc/functions.app_passwd.inc.php | 15 ++++----------
2 files changed, 4 insertions(+), 44 deletions(-)
Diff
diff --git a/data/web/api/openapi.yaml b/data/web/api/openapi.yaml
index 8c3eb75e..e1ef65bb 100644
--- a/data/web/api/openapi.yaml
+++ b/data/web/api/openapi.yaml
@@ -3520,39 +3520,6 @@ paths:
description: You can list mailbox aliases existing in system.
operationId: Get aliases
summary: Get aliases
- "/api/v1/get/app-passwd/all":
- get:
- - description: e.g. api-key-string
- example: api-key-string
- in: header
- name: X-API-Key
- required: false
- schema:
- type: string
- responses:
- "401":
- $ref: "#/components/responses/Unauthorized"
- "200":
- content:
- application/json:
- examples:
- response:
- value:
- - active: "1"
- created: "2019-12-21 16:04:55"
- domain: mailcow.email
- id: 2
- mailbox: [email protected]
- modified: null
- name: emclient
- description: OK
- headers: {}
- tags:
- - App Passwords
- description: >-
- Using this endpoint you can get all app passwords from all mailboxes.
- operationId: Get App Passwords
- summary: Get App Passwords
"/api/v1/get/app-passwd/all/{mailbox}":
get:
parameters:
diff --git a/data/web/inc/functions.app_passwd.inc.php b/data/web/inc/functions.app_passwd.inc.php
index 9b19aebe..b493fc91 100644
--- a/data/web/inc/functions.app_passwd.inc.php
+++ b/data/web/inc/functions.app_passwd.inc.php
@@ -216,17 +216,10 @@ function app_passwd($_action, $_data = null) {
break;
case 'get':
$app_passwds = array();
- 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;
- }
+ $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;
break;
case 'details':
$app_passwd_data = array();