infinityfreehosting / mofh-client Goto Github PK
View Code? Open in Web Editor NEWA WHM API client for MyOwnFreeHost in PHP
License: Apache License 2.0
A WHM API client for MyOwnFreeHost in PHP
License: Apache License 2.0
The message is generated when changing the password.
If an account does not exist, calling passwd on it simply returns an empty string without any error message or status codes. Because of this, it's impossible to know the account is actually deleted (unless you know it ;) ).
I ran this code in PHP:
print_r($client->availability("domain.com"));
but it returns 1
every time I try to do it. Even when I select a domain that is available.
how would we upload using ftp client cause my host does not support composer
How do I view user data on my site? Thank you for your response!
Generated while trying to change the password.
Hi,
I've managed to get the mofh-client on my website. Thing is, I'm quite confused. Is there any documentation that I could possibly refer to? Just that I'm quite new to this, and I would like to spend time coding these kinds of projects.
-Eqil
Title says everything.
Possible ?
#7 Thanks for this i been working on something like this for a year omg you do a good job wtih this i might abandend my project you a life saver keep up your good work but i have a issue makeing this work like profreehost do that use whmcs
Does the API have a function to change the email address of a user's hosting account?
If it does, could it be added as a method to this client?
Generated while trying to change the password.
So.. funny thing is... that when I make a plan and check "ad/banner free" when an account gets created it has banner turned on. It does not matter yet because I have no banners yet. But I will have a plan with more stuff and ads. So this will become a problem. Everything else works :)
That title may not make since so here is the problem: When creating an account with the createAccount
function. I set the plan to basic
(a plan I created earlier). basic
has a traffic of 200GB
, a disk of 20GB
, a MYSQL of 40
, and a domain of 20
. Although when I use the PHP to create the account using the plan basic
it creates an account with the correct MYSQL and Domains but with Traffic set to 209715200GB
and a Disk of 20971520GB
.
I do not know if this is a problem with this or with the MOFH Panel.
When the suspension reason is too short (at least 5 characters? need to test), the error The suspension reason is to short, please give a reason for suspension.
is returned.
I would like an example of how to use getDomainUser among others get from the project
Hi,there!
I am now just testing the script.But host should I write the domain string.
For examle, I have my reseller domain geoweb.host and want to test of rayhan.geoweb.host is availabe.
So how do I do this. An example would best.If any of you would kindly share an example it would very nice.
Thanks.
Fatal error: Class 'AbstractRequest' not found in F:\xamp\htdocs\w\moh\mofh-client-master\src\Message\CreateAccountRequest.php on line 6
how can solve it
I noticed on InfinityFree with your domain availability validation you return the reseller domain name when a domain is taken.
How do you do this as I don't think it's returned in the API response from the checkavailable
endpoint?
I made a Client Area, but it does not contain this. Could it be added as a php page without doing everything again?
When trying to unsuspend an account which is ADMIN_CLOSE
, the message This account appears to be admin suspended
is returned because you have to contact iFastNet about it. Add this message to the exception list.
Could you make a function to get the Support Questions and to reply to support questions. Because I would like to create a mobile app for the supporters that let's them view all the messages and reply to the messages. Thanks :)
Currently, the main Client class contains all logic related to building and processing the responses from the API. The size of the class is acceptable in the current implementation, but could easily grow as the number of API methods increases.
Instead, use a request/response factory model similar to Omnipay:
https://github.com/thephpleague/omnipay-stripe
https://github.com/thephpleague/omnipay-common
Hello,
I know from Infinityfree that it is a webpage. It is secure and it is just hosted on a host. How to do that? I don't have SSH access. I want to create accounts from a form.
Thank you,
Chris
Hhudzbfbhxjixishwbmwskkdjfbtbrjxjsbsjrirfoowfbbgjjxhbsnslzkx
When trying to search for (or create?) an account, you can encounter the error message ERROR : Sorry we do not support hosting .tk domains on free hosting.
, but no exception type has been defined for it.
Just a specific question so I can at least learn or get started.
Hi,
First of all thanks for making this!
Second, I understand how to make this but I need at least some example code so that I can experiment on it.
Can you please give an example code for a sign up form cause I'm not sure how to do it but I have an idea how to make it but still I won't work...
Please give example..
Filter error "The API key or API username entered is not valid"
The client should be tested properly with PHPUnit.
I do not have composer and I do not plan on getting it, can you tell me which files/directories I need to copy?
ho would i install using composer on myownfreehost
Hi,in last issue I had asked about domain searching.Now it's sloved by there's a big fault there.
Now I am creating a new account.
So, I chose username as "rayhansa" and domain "rayhan.geoweb.host"
It returns a string which is the cpanel usernname. But after I login into cpanel I get the main domin as rayhansa.geoweb.host
Rather,I should have gotten the main domain as rayhan.geoweb.host
So I kept the username field empty scince it was automatically generated. But I got errors.
Is there anything to do?????
there is no proper guide to install it.. please mail the details to [email protected]
The following error can appear when trying to create an account: ERROR :This domain name appears invalid (to short !)
, but no exception type has been defined for it.
Hi!
As I am completely new in php, I want to learn how can I get started.
I am ready to invest my time in learning php laravel anything, I have plenty of time.
But I want to make a front end with this API client. Like people first register their accounts then sub accounts will be registered with the actual hosting (as like as infinity's)
I want to learn. Can someone help me what all things I need to do? I have a windows 10 pc.
Since the previous issue had been closed, I'm going to ask my questions here. Let me know if we should just reopen the previous issue.
Hi, I had a few question after a while...
To create an account, we need to provide our own username to the API. What is this username used for (as I couldn't find it on MOFH Reseller Panel)? Also how do InfinityFree generates these usernames? And is it safe if we just use increments to generate this usernames?
How to retrieve the main domain? As far as I know, https://myprohost.ga uses this client to interface with MOFH's API and it has a Domain and Main Domain column as seen in the screenshot below:
I assume the domain column is filled with the domain supplied during account creation.
Generated when trying to change the password.
This is not an actual issue with the client but rather some questions that I had about the client that might be useful for everyone else.
Hi, I got the following warning:
( ! ) Warning: array_map(): Argument #2 should be an array in D:\wamp64\www\HansAdema-Client-Test\vendor\hansadema\mofh-client\src\Message\GetUserDomainsResponse.php on line 64
--
1 | 0.0008 | 402816 | {main}( ) | ...\index.php:0
2 | 1.1961 | 622208 | HansAdema\MofhClient\Message\GetUserDomainsResponse->getStatus( ) | ...\index.php:17
3 | 1.1962 | 622528 | array_map ( ) | ...\GetUserDomainsResponse.php:64
And this is line 62-64:
$statuses = array_unique(array_map(function ($item) {
return $item[0];
}, $data));
I've added the following code before line 62 for debugging:
var_dump($this->getMessage());
var_dump($this->getData());
var_dump($data);
The first one returns null
,
The second one returns a string of "null"
and the last one returns null
.
The username I've used for testing is test_12345678
and a few random ones like asdf_asdfasdf
and the conclusion is that any username that does not exist will result in "null" (string) being sent by the server which would then break the array_map function because the JSON could not decode the response properly and thus a null
was returned by json_decode
.
This is not an actual issue with the client but rather some questions that I had about the client that might be useful for everyone else.
Hoe do you handle the account status. Like suspended, active, closed etc. also how do you mention suspension is because of spam, suspension is because of inactivity, the suspension is because of MySQL overuse etc. I don't see any function for that in this client.
hi there, would like to know how to use the api in test mode? I have seen the documentation and it is a little incomplete for people who are not used to using libraries and I would like to know if the library is well installed and I do not want to test directly with the Myownfreehost API when creating the user and see what values it returns to me, thank you very much
Hi there,
When I create a new user using the latest 0.9 version of the MOFH client, it gives me the error: Error: Name servers for domain are not valid 84572435
.
I tried the old 0.7 version and it worked without problems.
Here is my code:
<?php
require_once './key.php';
use \InfinityFree\MofhClient\Client;
// Create a new API client with your API credentials.
$client =new Client(API_USERNAME, API_PASSWORD);
// Create a new hosting account.
$createResponse = $client->createAccount(
'68491739', // A unique, 8 character identifier of the account. Primarily used as internal identifier.
'password68491739', // A password to login to the control panel, FTP and databases.
'68491739.mydomain.com', // Initial domain of the account. Can be a subdomain or a custom domain.
'[email protected]', // The email address of the user.
'free', // The hosting plan name at MyOwnFreeHost.
);
// Check whether the request was successful.
if ($createResponse->isSuccessful()) {
echo "Created account with username: ".$createResponse->getVpUsername();
} else {
echo 'Failed to create account: ' . $createResponse->getMessage();
die();
}
This is a longshot - but is it possible to migrate over existing MOFH client information into my database using mofh-client? I have created my portal in Laravel, which lists users' hosting accounts, allows for creation of new hosting accounts, etc. To enable the ability of automatic cPanel login, I insert the chosen password on new account creation into my database (using an encryption algorithm and key). I also capture the mofh_username and currently logged-into Laravel user ID. These are inserted into my database as well.
mofh_username | laravel_user_id | password_enc | password_key |
---|---|---|---|
host_14307665 l | 1 | 1igSThVvj4EfImIjWg== | e4d909cd0ca068ffaddf22cbd0 |
host_26834112 | 2 | uIewK8nB42lOi9== | 9e107d72bb68d81d35a419d6 |
When a user account is validated (logged-in laravel_user_id
= mofh_username->laravel_user_id
), the password_enc and password_key are grabbed from the database, and the decrypted password is injected into the login form which instantly POSTs through to the MOFH cPanel. Is there a better, more secure way of doing this than requiring direct PHP injection of the password into the form? My process works for new user accounts created using the portal (since I associate the MOFH username with the laravel_user_id), but the 150 existing accounts would not be able to have their account logged into from the client panel with this current method. Is there a better way to do this when using mofh-client besides closing all accounts and starting over, ensuring account creation is only done from the client panel in the future?
Is it possible.
I am trying Get hosting ip
I wanted to know if there was a way to create a subdomain for an existing domain hosted on reseller hosting using the API.
Eg if example.com is setup on a reseller hosting account with username examp_123456, could I create the subdomain sub.example.com with the same username, using this API (adding the subdomain to the existing account)?
c6a450b8a1b66c2e78313a3809892dbf
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.