{"id":47190,"date":"2022-04-14T14:21:36","date_gmt":"2022-04-14T09:51:36","guid":{"rendered":"https:\/\/zardis.net\/news\/?p=47190"},"modified":"2022-04-14T14:28:33","modified_gmt":"2022-04-14T09:58:33","slug":"%d9%88%d8%b1%d9%88%d8%af-%d8%a8%d8%a7-%d8%b4%d9%85%d8%a7%d8%b1%d9%87-%d9%85%d9%88%d8%a8%d8%a7%db%8c%d9%84-%d8%af%d8%b1whmcs-%d8%a8%d8%ac%d8%a7%db%8c-%d8%a7%db%8c%d9%85%db%8c%d9%84","status":"publish","type":"post","link":"https:\/\/zardis.net\/news\/47190\/%d9%88%d8%b1%d9%88%d8%af-%d8%a8%d8%a7-%d8%b4%d9%85%d8%a7%d8%b1%d9%87-%d9%85%d9%88%d8%a8%d8%a7%db%8c%d9%84-%d8%af%d8%b1whmcs-%d8%a8%d8%ac%d8%a7%db%8c-%d8%a7%db%8c%d9%85%db%8c%d9%84\/","title":{"rendered":"\u0648\u0631\u0648\u062f \u0628\u0627 \u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06cc\u0644 \u062f\u0631whmcs \u0628\u062c\u0627\u06cc \u0627\u06cc\u0645\u06cc\u0644"},"content":{"rendered":"<p>\u0633\u0644\u0627\u0645 \u062e\u062f\u0645\u062a \u06a9\u0627\u0631\u0628\u0631\u0627\u0646 \u0645\u062d\u062a\u0631\u0645 \u0632\u0631\u062f\u06cc\u0633<\/p>\n<p>\u0627\u0645\u0631\u0648\u0632\u0647 \u0627\u06a9\u062b\u0631 \u0633\u0627\u0645\u0627\u0646\u0647 \u0647\u0627\u06cc \u067e\u06cc\u0627\u0645\u06a9\u06cc \u0648\u0631\u0648\u062f \u0628\u0627 \u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06cc\u0644 \u062f\u0631 whmcs \u0631\u0627 \u0641\u0631\u0627\u0647\u0645 \u0645\u06cc\u06a9\u0646\u0646\u062f \u0648\u0644\u06cc \u0646\u06cc\u0627\u0632 \u0628\u0647 \u062a\u0627\u06cc\u06cc\u062f \u06a9\u062f \u062f\u0627\u0631\u0646\u062f \u0648\u0644\u06cc \u062f\u0631 \u0635\u0648\u0631\u062a\u06cc \u06a9\u0647 \u0645\u06cc\u062e\u0648\u0627\u0647\u06cc\u062f \u0628\u0627 \u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06cc\u0644 \u0628\u062c\u0627\u06cc \u0627\u06cc\u0645\u06cc\u0644 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f \u06a9\u0627\u0641\u06cc\u0633\u062a \u062f\u0631 \u0633\u0627\u06cc\u062a \u062e\u0648\u062f \u0627\u0632 \u0647\u0648\u06a9 \u0632\u06cc\u0631 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\n<p>\u0644\u0627\u0632\u0645 \u0628\u0647 \u0630\u06a9\u0631 \u0627\u0633\u062a \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0627\u06cc\u0646 \u0631\u0648\u0634 \u060c \u0631\u0648\u0634 \u062e\u0648\u0628\u06cc \u0646\u0628\u0627\u0634\u062f \u0632\u06cc\u0631\u0627 \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u06cc\u06a9 \u0645\u0648\u0628\u0627\u06cc\u0644 \u0628\u0631\u0627\u06cc \u0686\u0646\u062f \u06a9\u0627\u0631\u0628\u0631 \u0645\u0648\u0631\u062f \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0642\u0631\u0627\u0631 \u06af\u0631\u0641\u062a\u0647 \u0628\u0627\u0634\u062f.<\/p>\n<p>\u0622\u0645\u0648\u0632\u0634 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0647\u0648\u06a9 \u0647\u0627 \u0631\u0627 \u062f\u0631 \u0645\u0642\u0627\u0644\u0647 \u0627\u06cc \u062c\u062f\u0627\u06af\u0627\u0646\u0647 \u062a\u0648\u0636\u06cc\u062d \u062f\u0627\u062f\u0647 \u0627\u06cc\u0645 \u06a9\u0647 \u0645\u06cc\u062a\u0648\u0627\u0646\u06cc\u062f \u0645\u0634\u0627\u0647\u062f\u0647 \u06a9\u0646\u06cc\u062f.(<a href=\"https:\/\/zardis.net\/news\/47191\/\" target=\"_blank\" rel=\"noopener\">\u06a9\u0644\u06cc\u06a9 \u06a9\u0646\u06cc\u062f<\/a>)<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\/\/ THIS IS BAD PRACTICE - MULTIPLE USERS CAN HAVE THE SAME PHONE NUMBER\r\n\r\nuse WHMCS\\Database\\Capsule;\r\n\r\nadd_hook('ClientLoginShare', 1, function ($vars) {\r\n\r\n    \/\/ Define username and password. Username is whatever the user enters in the 'email address' field.\r\n    $username = $vars&#x5B;'username'];\r\n    $password = $vars&#x5B;'password'];\r\n    \r\n    \/\/ Let's see if the user is logging in using an email address. If not, let's see if we can find the user's phone number in the database and allow them to login this way.\r\n    if (!filter_var($username, FILTER_VALIDATE_EMAIL)) {\r\n        $users = Capsule::table('tblclients')\r\n            -&gt;select('email')\r\n            -&gt;where('phonenumber', $username)\r\n            -&gt;get();\r\n\r\n        \/\/ If there's multiple users with the same phone number, allow _none_ of them to login by using their phone numbers. \r\n        \/\/ They will only be able to login using email address in that case\r\n        if (sizeof($users) &gt; 1) {\r\n            return false;\r\n        }\r\n\r\n        \/\/ Set the user's email address\r\n        foreach($users as $user){\r\n            $email = $user-&gt;email;\r\n        }\r\n\r\n        \/\/ Documentation: https:\/\/developers.whmcs.com\/api-reference\/validatelogin\/\r\n        $command = 'ValidateLogin';\r\n        $postData = array(\r\n            'email' =&gt; $email,\r\n            'password2' =&gt; $password,\r\n        );\r\n        \r\n        \/\/ Check if login is valid - if it is, log them in using email address\r\n        $isValid = localAPI($command, $postData);\r\n        if($isValid&#x5B;'result'] == &quot;true&quot;) {\r\n            return array(\r\n                'email' =&gt; $email,\r\n            );\r\n        }\r\n    }\r\n});\r\n\r\n\r\nadd_hook('ClientAreaFooterOutput', 1, function($vars) {\r\n    \/\/ Change login input field to allow any text\r\n    $changeLoginInput = '&lt;script&gt;$( document ).ready(function() {\r\n        $(&quot;#inputEmail&quot;).prop({type:&quot;text&quot;});\r\n    });&lt;\/script&gt;';\r\n    return $changeLoginInput;\r\n});\r\n\r\n<\/pre>\n<p>\u0627\u06cc\u0646 \u0645\u0637\u0644\u0628 \u0628\u0647 \u0635\u0648\u0631\u062a \u0627\u062e\u062a\u0635\u0627\u0635\u06cc \u062a\u0648\u0633\u0637 \u0632\u0631\u062f\u06cc\u0633 \u0646\u0648\u0634\u062a\u0647 \u0634\u062f\u0647 \u0627\u0633\u062a \u0648 \u0628\u0627\u0632\u0646\u0634\u0631 \u0628\u062f\u0648\u0646 \u0646\u0627\u0645 \u0645\u0646\u0628\u0639 \u062e\u0627\u0631\u062c \u0627\u0632 \u0645\u0631\u0627\u0645 \u0648 \u0645\u0639\u0631\u0641\u062a \u0627\u0633\u062a \ud83d\ude41<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0633\u0644\u0627\u0645 \u062e\u062f\u0645\u062a \u06a9\u0627\u0631\u0628\u0631\u0627\u0646 \u0645\u062d\u062a\u0631\u0645 \u0632\u0631\u062f\u06cc\u0633 \u0627\u0645\u0631\u0648\u0632\u0647 \u0627\u06a9\u062b\u0631 \u0633\u0627\u0645\u0627\u0646\u0647 \u0647\u0627\u06cc \u067e\u06cc\u0627\u0645\u06a9\u06cc \u0648\u0631\u0648\u062f \u0628\u0627 \u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06cc\u0644 \u062f\u0631 whmcs \u0631\u0627 \u0641\u0631\u0627\u0647\u0645 \u0645\u06cc\u06a9\u0646\u0646\u062f \u0648\u0644\u06cc \u0646\u06cc\u0627\u0632 \u0628\u0647 \u062a\u0627\u06cc\u06cc\u062f \u06a9\u062f \u062f\u0627\u0631\u0646\u062f \u0648\u0644\u06cc \u062f\u0631 \u0635\u0648\u0631\u062a\u06cc \u06a9\u0647 \u0645\u06cc\u062e\u0648\u0627\u0647\u06cc\u062f \u0628\u0627 \u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06cc\u0644 \u0628\u062c\u0627\u06cc \u0627\u06cc\u0645\u06cc\u0644 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f \u06a9\u0627\u0641\u06cc\u0633\u062a \u062f\u0631 \u0633\u0627\u06cc\u062a \u062e\u0648\u062f \u0627\u0632 \u0647\u0648\u06a9 \u0632\u06cc\u0631 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f. \u0644\u0627\u0632\u0645 \u0628\u0647 \u0630\u06a9\u0631 \u0627\u0633\u062a \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0627\u06cc\u0646 \u0631\u0648\u0634 \u060c [&hellip;]<\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[9463],"tags":[],"class_list":["post-47190","post","type-post","status-publish","format-standard","hentry","category-whmcs"],"acf":[],"_links":{"self":[{"href":"https:\/\/zardis.net\/news\/wp-json\/wp\/v2\/posts\/47190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zardis.net\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zardis.net\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zardis.net\/news\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/zardis.net\/news\/wp-json\/wp\/v2\/comments?post=47190"}],"version-history":[{"count":0,"href":"https:\/\/zardis.net\/news\/wp-json\/wp\/v2\/posts\/47190\/revisions"}],"wp:attachment":[{"href":"https:\/\/zardis.net\/news\/wp-json\/wp\/v2\/media?parent=47190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zardis.net\/news\/wp-json\/wp\/v2\/categories?post=47190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zardis.net\/news\/wp-json\/wp\/v2\/tags?post=47190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}