Browse Source

add script for ajax response

Andre Genrich 5 years ago
parent
commit
d6af83fa2f
1 changed files with 20 additions and 0 deletions
  1. 20 0
      zimbraAddressCheck.php

+ 20 - 0
zimbraAddressCheck.php

@@ -0,0 +1,20 @@
+<?php
+$allowed_host = 'admin.seecure.ch';
+$host = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST);
+
+if(substr($host, 0 - strlen($allowed_host)) != $allowed_host) {
+  die("This file cannot be accessed directly");
+}
+require_once("api/Zm/Auth.php");
+require_once("api/Zm/Account.php");
+
+$account_name = $_GET['name'] . "@" .  $_GET['domain'];
+$api = new Zm_Auth('192.168.16.225', 'admin@thurdata.local', 'Technics2312', "admin");
+$login = $api->login();
+$apiAccountManager = new Zm_Account($api);
+if( $apiAccountManager->accountExists($account_name)) {
+	echo 'no';
+} else {
+	echo 'yes';
+}
+