Jump to content

JesusSuarz

Member
  • Content Count

    75
  • Joined

  • Last visited

Community Reputation

8 Neutral

About JesusSuarz

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. edita el perfil del cliente, y cambia el "estado o ciudad" por una válida de México. y lo intentas nuevamente.
  2. saludos, estás usando un VPS o un hosting compartido?
  3. Es un error que jamás había visto, más se me hacen 2 cosas posibles: 1) que no tengas licencias o la tengas inactiva. esto podría ser causante para que al no detectar la licencia de una mande a colocar tus clientes inactivos. 2) que "alguien" tenga acceso a tu whmcs y este realizando esto con una consulta. son las únicas 2 cosas que se me ocurren ..
  4. this was the solution for me: enable these options in my php.ini curl.cainfo = /etc/pki/tls/certs/ca-bundle.crt openssl.cafile = /etc/pki/tls/certs/ca-bundle.crt exactly the same path. (Obviously the server must have a certificate issued for this to work). furthermore i updated to curl 7.76.1 with the following. 1) create a new file /etc/yum.repos.d/city-fan.repo 2) Paste the following contents: [CityFan] name=City Fan Repo baseurl=http://www.city-fan.org/ftp/contrib/yum-repo/rhel$releasever/$basearch/ enabled=1 gpgcheck=0 3) type: yum clean all yum install curl 4) And it's done. at the end I have removed the repository to not receive new updates from any other package.
  5. this was the solution for me: enable these options in my php.ini curl.cainfo = /etc/pki/tls/certs/ca-bundle.crt openssl.cafile = /etc/pki/tls/certs/ca-bundle.crt exactly the same path. (Obviously the server must have a certificate issued for this to work). furthermore i updated to curl 7.76.1 with the following. 1) create a new file /etc/yum.repos.d/city-fan.repo 2) Paste the following contents: [CityFan] name=City Fan Repo baseurl=http://www.city-fan.org/ftp/contrib/yum-repo/rhel$releasever/$basearch/ enabled=1 gpgcheck=0 3) type: yum clean all yum install curl 4) And it's done. at the end I have removed the repository to not receive new updates from any other package.
  6. this was the solution for me: enable these options in my php.ini curl.cainfo = /etc/pki/tls/certs/ca-bundle.crt openssl.cafile = /etc/pki/tls/certs/ca-bundle.crt exactly the same path. (Obviously the server must have a certificate issued for this to work). furthermore i updated to curl 7.76.1 with the following. 1) create a new file /etc/yum.repos.d/city-fan.repo 2) Paste the following contents: [CityFan] name=City Fan Repo baseurl=http://www.city-fan.org/ftp/contrib/yum-repo/rhel$releasever/$basearch/ enabled=1 gpgcheck=0 3) type: yum clean all yum install curl 4) And it's done. at the end I have removed the repository to not receive new updates from any other package.
  7. while working with the api I realized that getproducts (https://developers.whmcs.com/api-reference/getproducts/) does not bring up the field to know if the product is active or not. I saw someone post a similar idea several years ago: so with a little engineer I made my own version of getproducts and uploaded it to /includes/api/ Request Parameters "GetProductsActive" Parameter Type Description Required action string “GetProductsActive” Required pid int string Obtain a specific product id configuration. Can be a list of ids comma separated gid int Retrieve products in a specific group id Optional Response Parameters Parameter Type Description result string The result of the operation: success or error totalresults int The total number of results available startnumber int The starting number for the returned results numreturned int The number of results returned products array An array of products matching the criteria passed I will leave the file called: getproductsactive.php however this may throw an api error, you have to give access in the table tblapi_roles in database, in the field: permissions add: ,"getproductsactive": 1 before closing }, This modification is due to WHMCS not showing the files added in includes/api as a role. (I do not know why). With this you can get the field: hidden which defines 0 if it is visible and 1 if it is hidden. (true or false also works) my code is a copy of includes/api/getproduct.php just add to show the hidden field (, "hidden" => $data["hidden"]), this would have been easier if WHMCS implemented it, it only took me 2 minutes to show this field. <?php if (!defined("WHMCS")) { exit("This file cannot be accessed directly"); } if (!function_exists("getCustomFields")) { require ROOTDIR . "/includes/customfieldfunctions.php"; } if (!function_exists("getCartConfigOptions")) { require ROOTDIR . "/includes/configoptionsfunctions.php"; } global $currency; $currency = getCurrency(); $pid = $whmcs->get_req_var("pid"); $gid = $whmcs->get_req_var("gid"); $module = $whmcs->get_req_var("module"); $where = array(); if ($pid) { if (is_numeric($pid)) { $where[] = "tblproducts.id=" . (int) $pid; } else { $pids = array(); foreach (explode(",", $pid) as $p) { $p = (int) trim($p); if ($p) { $pids[] = $p; } } if ($pids) { $where[] = "tblproducts.id IN (" . implode(",", $pids) . ")"; } } } if ($gid) { $where[] = "gid=" . (int) $gid; } if ($module && preg_match("/^[a-zA-Z0-9_\\.\\-]*\$/", $module)) { $where[] = "servertype='" . db_escape_string($module) . "'"; } $result = select_query("tblproducts", "tblproducts.*", implode(" AND ", $where), "tblproductgroups`.`order` ASC, `tblproductgroups`.`id` ASC, `tblproducts`.`order` ASC, `tblproducts`.`id", "ASC", "", "tblproductgroups ON tblproducts.gid = tblproductgroups.id"); $apiresults = array("result" => "success", "totalresults" => mysql_num_rows($result)); while ($data = mysql_fetch_array($result)) { $pid = $data["id"]; $productarray = array("pid" => $data["id"], "gid" => $data["gid"], "type" => $data["type"], "name" => $data["name"], "description" => $data["description"], "module" => $data["servertype"], "paytype" => $data["paytype"], "hidden" => $data["hidden"]); if ($language = $whmcs->get_req_var("language")) { $productarray["translated_name"] = WHMCS\Product\Product::getProductName($data["id"], $data["name"], $language); $productarray["translated_description"] = WHMCS\Product\Product::getProductDescription($data["id"], $data["description"], $language); } if ($data["stockcontrol"]) { $productarray["stockcontrol"] = "true"; $productarray["stocklevel"] = $data["qty"]; } $result2 = select_query("tblpricing", "tblcurrencies.code,tblcurrencies.prefix,tblcurrencies.suffix,tblpricing.msetupfee,tblpricing.qsetupfee,tblpricing.ssetupfee,tblpricing.asetupfee,tblpricing.bsetupfee,tblpricing.tsetupfee,tblpricing.monthly,tblpricing.quarterly,tblpricing.semiannually,tblpricing.annually,tblpricing.biennially,tblpricing.triennially", array("type" => "product", "relid" => $pid), "code", "ASC", "", "tblcurrencies ON tblcurrencies.id=tblpricing.currency"); while ($data = mysql_fetch_assoc($result2)) { $code = $data["code"]; unset($data["code"]); $productarray["pricing"][$code] = $data; } $customfieldsdata = array(); $customfields = getCustomFields("product", $pid, "", "", "on"); foreach ($customfields as $field) { $customfieldsdata[] = array("id" => $field["id"], "name" => $field["name"], "description" => $field["description"], "required" => $field["required"]); } $productarray["customfields"]["customfield"] = $customfieldsdata; $configoptiondata = array(); $configurableoptions = getCartConfigOptions($pid, array(), "", "", "", true); foreach ($configurableoptions as $option) { $options = array(); foreach ($option["options"] as $op) { $pricing = array(); $result4 = select_query("tblpricing", "code,msetupfee,qsetupfee,ssetupfee,asetupfee,bsetupfee,tsetupfee,monthly,quarterly,semiannually,annually,biennially,triennially", array("type" => "configoptions", "relid" => $op["id"]), "", "", "", "tblcurrencies ON tblcurrencies.id=tblpricing.currency"); while ($oppricing = mysql_fetch_assoc($result4)) { $currcode = $oppricing["code"]; unset($oppricing["code"]); $pricing[$currcode] = $oppricing; } $options["option"][] = array("id" => $op["id"], "name" => $op["name"], "rawName" => $op["rawName"], "recurring" => $op["recurring"], "required" => $op["required"], "pricing" => $pricing); } $configoptiondata[] = array("id" => $option["id"], "name" => $option["optionname"], "type" => $option["optiontype"], "options" => $options); } $productarray["configoptions"]["configoption"] = $configoptiondata; $apiresults["products"]["product"][] = $productarray; } $responsetype = "xml"; ?> Hope this helps others to show the field they need to show files and hidden products. getproductsactive.php
  8. the problem is that this only works if you have your whmcs in a sub-folder. however if you use another sub-domain I could not manage to transfer the cookie ... therefore it only works if it is domain.com/whmcs but if it is dashboard.domain.com it doesn't work. whmcs should include a field in the database that says if the client is connected or not ... this would improve the way of querying the data through another domain with the api.
  9. Has anyone really worked with sessions in different domains with whmcs? ... Isn't there a way to identify if a user is logged in from a sub-domain? It seems that WHMCS should add a field in the customer table that indicates whether the user is logged in or not, it would be quite a useful function. or if there is any other way then they should mention it.
  10. Hello, Why do you think it cannot be used in another domain? I have a similar theme here:
  11. Hello, I'm trying to get some way to query if a user is online. I don't want to know the current user. if not something you can define for example $clientid or $userid or $emailclient ... I am making an external site. and i need to work with user sessions. (I am making a remote connection with the api). this function does not currently exist in the api available. I've been seeing this: https://developers.whmcs.com/advanced/authentication/ however I do not see that it allows to define the user. I was also seeing this: https://docs.whmcs.com/Sessions I was able to save the cookie in the database, however I can't find any way to identify the one that belongs to each user. any idea how I can get (which users are online?) .. (please nothing to do with smarty, only php). postdata: forget to tell the method I use to get user authentication in my application. create the following code for my application: I first make a connection to the api: https://developers.whmcs.com/api/authentication/ soon ValidateLogin: https://developers.whmcs.com/api-reference/validatelogin/ soon GetClientsDetails: https://developers.whmcs.com/api-reference/getclientsdetails/ soon CreateSsoToken: https://developers.whmcs.com/api-reference/createssotoken/ // validar usuario $command = 'ValidateLogin'; $postData = array( 'email' => $email_user, //post 'password2' => $password_user, //post ); $api_login = localAPI($command, $postData); //var de id de usuario: $api_login["userid"]; // si se encuentra el user entonces traer detalles del usuario via email $clientid = array(); // array que tiene el id del cliente if ($api_login["userid"] == true) { $command = 'GetClientsDetails'; $postData = array( 'email' => $email_user, // email login ); $details_client = localAPI($command, $postData); $clientid[] = $details_client["client_id"]; } // variable del clientid es: $clientid[0]; // crear token de session $command = 'CreateSsoToken'; $postData = array( 'client_id' => $clientid[0], ); $results_ssotoken = localAPI($command, $postData); echo '<pre>'; var_dump($results_ssotoken); echo '</pre>'; this will create the url with (CreateSsoToken) where the user will be redirected for autologin, however the cookie is created only after entering the client area. that's why I don't know how to get the cookie, or identify the user. @brian! would you help me with this?
  12. in other words, I am trying to get the custom values of a product from a customer....
  13. Hello I have a variable that is printed with {debug} in the tpl template. however I want to get the result in php of this variable. I need to get $customfields from a hook. how could you access $customfields that is printed inside a product @brian! could you help me?
  14. you were right, although it was $client->isEmailAddressVerified() the () were missing at the end. here is a new version of the code written. the texts are in Spanish, sorry. 🙂
  15. sometimes the client can have 2 emails. one for your account details and one for the account owner. I need to know if the account owner's email is verified. The var: $client = Menu::context("client"); gets the email that the customer has in the account details, however this is not the email owner of the account. I hope to make myself understood correctly.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated