Code Monkey home page Code Monkey logo

mofh-client's People

Contributors

bastelpichi avatar dependabot[bot] avatar greenreader9 avatar grendel7 avatar pauladams8 avatar planetthecloud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mofh-client's Issues

Is it supposed to do this?

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.

Uploaded

how would we upload using ftp client cause my host does not support composer

HELP

How do I view user data on my site? Thank you for your response!

Documentation

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

Incomplete Plan - Part II

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 :)

Incomplete Plan

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.

Example getDomainUser

I would like an example of how to use getDomainUser among others get from the project

What Do you mean by $domain

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.

Find reseller of unavailable domain

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?

Filter: This account appears to be admin suspended

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.

Support API

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 :)

How to use it in a PHP file?

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

Sign up

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..

Write tests

The client should be tested properly with PHPUnit.

Install without composer

I do not have composer and I do not plan on getting it, can you tell me which files/directories I need to copy?

Install

ho would i install using composer on myownfreehost

New account's username turns into main domain

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?????

How to get started?

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.

Question about the client and InfinityFree (#2)

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...

  1. 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?

  2. 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:
    image
    I assume the domain column is filled with the domain supplied during account creation.

Questions about the client

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.

array_map(): Argument #2 should be an array in src\Message\GetUserDomainsResponse.php on line 6

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.

How do you handle account status

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.

Use library in test mode

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

Error: Name servers for domain are not valid 84572435

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();
}

Existing user info with mofh-client

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?

Creating a subdomain with the API

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)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.