Jelajahi Sumber

Add confirmed delete.

Shane Mc Cormack 7 tahun lalu
induk
melakukan
123122c1de
1 mengubah file dengan 14 tambahan dan 0 penghapusan
  1. 14 0
      src/MyDNSHostAPI.php

+ 14 - 0
src/MyDNSHostAPI.php

@@ -352,6 +352,20 @@
 			return $this->api('/users/' . $userID, 'DELETE');
 		}
 
+		/**
+		 * Confirm delete the given user id
+		 *
+		 * @param $userid User ID to delete.
+		 * @param $confirmCode Confirmation code.
+		 * @param $twoFactorCode Optional twofactor code.
+		 * @return Result from the api
+		 */
+		public function deleteUserConfirm($userID, $confirmCode, $twoFactorCode = '') {
+			if ($this->auth === FALSE) { return []; }
+
+			return $this->api('/users/' . $userID . '/confirm/' . $confirmCode . (!empty($twoFactorCode) ? '/' . $twoFactorCode : ''), 'DELETE');
+		}
+
 		/**
 		 * Get API Keys for a user
 		 *