aoit

Member
Jun 4, 2006
5
0
151
I have a script that builds sites using a lot of automation. The issue that I have is that WHM recently updated to v 54, which removed x3 theme, and I think Security Token configuration. Is there a way to get x3 theme back? What changes to Security Tokens were made with v 54? Is there a way to revert back other than a full system restore?
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
79
458
cPanel Access Level
Root Administrator
The X3 theme is still available in version 54. Also, we made no changes to security tokens in version 54. Could you provide us with more information on the problem you are encountering?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello :)

I suggest exploring the use of the Paper Lantern theme:

It’s time to say goodbye to X3 | cPanel Blog

As far as security tokens, there's no change to that functionality, but it's important to note the following from the release notes:

API Access
If two-factor authentication is enabled, some API calls will be blocked. The system does not allow basic HTTP auth API calls when authenticated as a user with 2FA configured. You must establish a session and include the session's security token when making the API calls. For more information, read our Guide to API Authentication documentation.
Could you elaborate on the type of plugin or custom script you are using? Is it directly related to the theme?

Thank you.
 

aoit

Member
Jun 4, 2006
5
0
151
Here is the snip of code that is failing. Domains have been replaced with domain1,2,3.... The error is ending up with status==1

Code:
We are checking to see if a subdomain exists before creating it, using the cPanel subdomain functions. Ideas on how to fix this?

//NOTE: Check to see if the subdomain exists...
  $subdomain = $DOMAIN . $EXTENSION; //'.domain1.com';

  $path = null;
  if ($EXTENSION === '.domain1.com') {
  $path = "https://domain1:[email protected]$configServer:2083/frontend/paper_lantern/subdomain/index.html";
  } else if ($EXTENSION === '.domain2.net') {
  $path = "https://domain2:[email protected]$configServer:2083/frontend/paper_lantern/subdomain/index.html";
  } else if ($EXTENSION === '.domain3.com') {
  $path = "https://domain3:[email protected]$configServer:2083/frontend/paper_lantern/subdomain/index.html";
  } else if ($EXTENSION === '.domain4.com') {
  $path = "https://domain4:[email protected]$configServer:2083/frontend/paper_lantern/subdomain/index.html";
  } else if ($EXTENSION === '.domain5.com') {
  $path = "https://domain5:[email protected]$configServer:2083/frontend/paper_lantern/subdomain/index.html";
  } else if ($EXTENSION === '.domain6.com') {
  $path = "https://domain6:[email protected]$configServer:2083/frontend/paper_lantern/subdomain/index.html";
  }

  $f = fopen($path, "r");
  $status = 0;

  if (!$f) {
  $status = 1;
  } else {

  //check if the account exists
  while (!feof($f)) {
  $line = fgets($f, 1024);
  //NOTE: Was -- if (ereg($subdomain, $line, $out)) {
  if (stristr($line, $subdomain)) {
  $status = 2;
  }
  }

  fclose($f); //close the file resource
  }

  if ($status == 1) {
  echo '<div class="error_message">We are sorry, there was an error. Please try again.</div>';
  exit();
  } else if ($status == 2) {
  echo '<div class="error_message">We are sorry, but that domain already exists.</div>';
  exit();
  } else {
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463