Jump to content
[MUST READ] Forum Rules ×

TinkerMan

Senior Members
  • Posts

    1043
  • Joined

  • Last visited

Everything posted by TinkerMan

  1. I dident, but that does not seem to be it, as after adding it the error is still shown. src/function/NewAccount.php (Other files remain the same as above post) <?php require __DIR__.'/Connect.php'; require __DIR__.'/../handler/CookieHandler.php'; require_once __DIR__.'/../handler/AreaHandler.php'; require_once __DIR__.'/../modules/autoload.php'; use \InfinityFree\MofhClient\Client; if(isset($_POST['submit'])){ $FormData = array( 'username' => substr(str_shuffle('qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM'),0,8), 'password' => substr(str_shuffle('?!qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM?!@#$%^&*/'),0,6), 'domain' => $_POST['domain'], 'email' => $ClientInfo['hosting_client_email'], 'plan' => $_POST['package'], 'label' => $_POST['label'] ); if(empty($FormData['domain'])){ $_SESSION['message'] = '<div class="alert alert-danger" role="alert"> <button class="close" data-dismiss="alert" type="button" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> Domain cannot be <b>empty!</b> </div>'; header('location: ../newaccount.php'); } else{ $sql = mysqli_query($connect,"SELECT * FROM `hosting_account` WHERE `account_for`='".$ClientInfo['hosting_client_key']."'"); if(mysqli_num_rows($sql)<3){ $client = Client::create(); $request = $client->createAccount([ 'username' => $FormData['username'], 'password' => $FormData['password'], 'domain' => $FormData['domain'], 'email' => $FormData['email'], 'plan' => $FormData['plan'] ]); $response = $request->send(); $Data = $response->getData(); $Result = array( 'username' => $Data['result']['options']['vpusername'], 'message' => $Data['result']['statusmsg'], 'status' => $Data['result']['status'], 'domain' => str_replace('cpanel', strtolower($FormData['username']), API_CPANEL_URL), 'date' => date('m-j-Y'), 'time' => date('G-i-s'), 'timeanddate' => date('m-j-Y-G-i-s'), 'label' => $FormData['label'] ); if($Result['status']==0 && strlen($Result['message'])>1){ $_SESSION['message'] = '<div class="alert alert-danger" role="alert"> <button class="close" data-dismiss="alert" type="button" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> '.$Result['message'].' </div>'; header('location: ../newaccount.php'); exit; } elseif($Result['status']==1 && strlen($Result['message'])>1){ $sql = mysqli_query($connect,"INSERT INTO `hosting_account`(`account_username`, `account_password`, `account_domain`, `account_key`, `account_status`, `account_date`, `account_time`, `account_timeanddate`, `account_for`, `account_label`) VALUES ('".$Result['username']."','".$FormData['password']."','".$FormData['domain']."','".$Result['username']."','1','".$Result['date']."','".$Result['time']."','".$Result['timeanddate']."','".$ClientInfo['hosting_client_key']."','".$Result['label']."')"); ... The fist error message is the one triggered: else{ $_SESSION['message'] = '<div class="alert alert-danger" role="alert"> <button class="close" data-dismiss="alert" type="button" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> Something went <b>wrong!</b> </div>'; header('location: ../newaccount.php'); exit; }
  2. I'm trying to customize a bit, but it is not working. What am I doing wrong? ORIGINAL CODE: DATABASE: CREATE TABLE `hosting_account` ( `account_id` INT(11) PRIMARY KEY AUTO_INCREMENT NOT NULL, `account_username` VARCHAR(22) NOT NULL, `account_password` VARCHAR(16) NOT NULL, `account_domain` VARCHAR(70) NOT NULL, `account_key` VARCHAR(8) NOT NULL, `account_status` INT(1) NOT NULL, `account_date` VARCHAR(20) NOT NULL, `account_for` INT(6) NOT NULL) src/function/NewAccount.php ... else{ $sql = mysqli_query($connect,"SELECT * FROM `hosting_account` WHERE `account_for`='".$ClientInfo['hosting_client_key']."'"); if(mysqli_num_rows($sql)<3){ $client = Client::create(); $request = $client->createAccount([ 'username' => $FormData['username'], 'password' => $FormData['password'], 'domain' => $FormData['domain'], 'email' => $FormData['email'], 'plan' => $FormData['plan'] ]); $response = $request->send(); $Data = $response->getData(); $Result = array( 'username' => $Data['result']['options']['vpusername'], 'message' => $Data['result']['statusmsg'], 'status' => $Data['result']['status'], 'domain' => str_replace('cpanel', strtolower($FormData['username']), API_CPANEL_URL), 'date' => date('d-m-Y') ); if($Result['status']==0 && strlen($Result['message'])>1){ $_SESSION['message'] = '<div class="alert alert-danger" role="alert"> <button class="close" data-dismiss="alert" type="button" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> '.$Result['message'].' </div>'; header('location: ../newaccount.php'); exit; } elseif($Result['status']==1 && strlen($Result['message'])>1){ $sql = mysqli_query($connect,"INSERT INTO `hosting_account`(`account_username`, `account_password`, `account_key`, `account_domain`, `account_status`, `account_date`, `account_for`) VALUES ('".$Result['username']."','".$FormData['password']."','".$FormData['username']."','".$Result['domain']."','1','".$Result['date']."','".$ClientInfo['hosting_client_key']."')"); ... NEW CODE: DATEBASE: (Adds some info described below) CREATE TABLE `hosting_account` ( `account_id` int(11) NOT NULL, `account_username` varchar(22) NOT NULL, `account_password` varchar(16) NOT NULL, `account_domain` varchar(70) NOT NULL, `account_key` varchar(8) NOT NULL, `account_status` int(1) NOT NULL, `account_date` varchar(20) NOT NULL, `account_time` varchar(20) NOT NULL, `account_dateandtime` varchar(100) NOT NULL, `account_for` int(6) NOT NULL, `account_label` varchar(255) NOT NULL ) src/template/NewAccount.php (Added around line 77, basically another text field to fill out when creating an account) <div class="col-md-6"> <div class="mb-10 px-10"> <label class="form-label required">Account Name</label> <input type="text" name="label" placeholder="Name this account!" class="form-control" required="true"> </div> </div> src/function/NewAccount.php (Now collects timestamp as well, and what was entered into the new text field). ... else{ $sql = mysqli_query($connect,"SELECT * FROM `hosting_account` WHERE `account_for`='".$ClientInfo['hosting_client_key']."'"); if(mysqli_num_rows($sql)<3){ $client = Client::create(); $request = $client->createAccount([ 'username' => $FormData['username'], 'password' => $FormData['password'], 'domain' => $FormData['domain'], 'email' => $FormData['email'], 'plan' => $FormData['plan'] ]); $response = $request->send(); $Data = $response->getData(); $Result = array( 'username' => $Data['result']['options']['vpusername'], 'message' => $Data['result']['statusmsg'], 'status' => $Data['result']['status'], 'domain' => str_replace('cpanel', strtolower($FormData['username']), API_CPANEL_URL), 'date' => date('m-j-Y'), 'time' => date('G-i-s'), 'timeanddate' => date('m-j-Y-G-i-s'), 'label' => $FormData['label'] ); if($Result['status']==0 && strlen($Result['message'])>1){ $_SESSION['message'] = '<div class="alert alert-danger" role="alert"> <button class="close" data-dismiss="alert" type="button" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> '.$Result['message'].' </div>'; header('location: ../newaccount.php'); exit; } elseif($Result['status']==1 && strlen($Result['message'])>1){ $sql = mysqli_query($connect,"INSERT INTO `hosting_account`(`account_username`, `account_password`, `account_domain`, `account_key`, `account_status`, `account_date`, `account_time`, `account_timeanddate`, `account_for`, `account_label`) VALUES ('".$Result['username']."','".$FormData['password']."','".$FormData['domain']."','".$Result['username']."','1','".$Result['date']."','".$Result['time']."','".$Result['timeanddate']."','".$ClientInfo['hosting_client_key']."','".$FormData['label']."')"); ... Thanks
  3. Make sure you have the country set in the profile. I do believe it still returns and error though, although its a different one
  4. ALERT! If incorrect CSR code in entered into the new SSL page, info that should remain secret is displayed. Try entering "fff" into the box and click "enter" to test it out yourself.
  5. I was just about to say that it is still not working. @Shen Wei, are you trying this on free hosting?
  6. What is this used for? Also, when can we the suspension bug fix to be released?
  7. Try re-installing MOFHY, everything works for me. Also, can you give the exact error message? Thanks
  8. and ftp.yourdomain.com for FTP (Unless you are using a different FTP server).
  9. Accounts suspended in the MOFH panel do not show suspended in the client area.
  10. Want to know why I hate computers? Its because they begin working when you do something totally unrelated. As soon as I turned on PHP errors, the domain sections started working, and so did the dropdown menu. (It still works after PHP errors are turned off) However, the accounts still don't show suspended when they actually are. (MOFH API and control panel show suspended, client area shows active). When PHP errors are on, nothing shows up, and everything else behaves normally.
  11. Something must be off here then. The person icon, domain section, and the connection between the client area and the API for suspended accounts still does not work! Could you upload your working copy of MOFHY to Google Drive/Dropbox/ect. and send me the link? Maybe something is wrong on my end...
  12. Still the same. I did a fresh install, but connected to the old database. Some of the test accounts I created were suspended for being created with a disposable email (Makes sense, I used one that does not exist), but even those don't show as suspended in the client area. The ones I manually suspended also don't show, even after a log-out. The person icon on myaccounts.php still does not work if the account is in the "Active" state. If one account is suspended, it allows you to create another one. So if I have 2 suspended accounts, it will allow me to create a total of 5 accounts. It dosent seam to count suspended accounts towards the three account limit. One last thing. The "Accounts" Counter on the homepage after the client logs in only counts "Active" accounts. The "Suspended" accounts don't add to that counter. Also, where can I get MOFHY Premium?
  13. Where is it avalible? Also, can the other issues pertaining to the drop-down menu and the suspension system be fixed?
  14. 1. A new install fixes the issue of having four accounts (The limit is back to three) 2. After fresh install, the suspensions still don't work properly (panel.myownfreehost.net and the control panel say suspended, but the client area does not) OR (client area says suspended but panel.myownfreehost.net and the control panel do not) 3. The person icon in the upper left still does not work on myaccounts.php (It seams to work if the account is "Suspended" or "Inactive" but it does not work if the account is "Active") 3. What is MOFHY Premium?
  15. HUGE issues! 1. The max here is 3, not 4!!! 2. When account is suspended from panel.myownfreehost.net, the client area does not show suspension!!! (The client area account has signed-out and signed back in, the suspension still does not show) Control Panel: panel.myownfreehost.net: Client Area: Similarly, if the user is suspended via the database, ONLY the client area updates, the control panel and panel.myownfreehost.net stay as "Active" A less important thing, but the person icon (Which houses the theme switch button) cannot be opened from the myaccounts.php page. Sorry about bringing all these things to your attention at once, but I have way to much extra times on my hands right now ?
  16. Also, the domains section just shows a black box with the text "Account Domains". The pages source code also seams messed up (The last div is not closed). <div class="card py-0"> <div class="d-flex justify-content-between align-items-center pt-15"> <h5 class="m-0">Account Domains</h5> </div> <hr> <div class="mb-10"> Oh, and the Hosting API
×
×
  • Create New...