View Full Version : Links
Tony - CTO
08-24-2003, 02:30 PM
Is it possible to add text links to the main overview screen for the clients? If so, what file should be edited in order to accomplish this.
I have added a new phpbb forum for the mebers and if I can add a text link to the main overview page then ClientExec will provide the login in order to obtain the link(s)
Thanks
Alberto
08-24-2003, 02:38 PM
You can edit
template/Raleigh/include/menus/clientmenu_home.tpl
Tony - CTO
08-24-2003, 03:11 PM
You can edit
template/Raleigh/include/menus/clientmenu_home.tpl
Thank You, Alberto
PS, where in FL are you? maybe we should get together and have lunch and talk business.
Alberto
08-24-2003, 04:55 PM
Contact me via email at alberto@clientexec.com I'm Orlando as well.
DR4296
10-14-2003, 01:03 PM
Greetings guys!
I wanted to add some dynamically-created links to the overall menu, specifically starting with the file that Alberto mentioned:
template/Raleigh/include/menus/clientmenu_home.tpl
I wanted links that the user could click on to be thrown into Cpanel or to Neomail (which comes with Cpanel). However, I need to pull in the username and password and domain name in order to build these links... sort of like:
<TD><IMG src="templates/{TEMPLATE}/images/navbar_divider.gif"></TD>
<TD><A href="http://{DOMAINUSERNAME}:{DOMAINPASSWORD}@{DOMAINNAME}/cpanel"><IMG src="templates/{TEMPLATE}/images/navbar_cpanel.jpg" height="26" width="53" border="0"></A></TD>
<TD><IMG src="templates/{TEMPLATE}/images/navbar_divider.gif"></TD>
<TD><A href="http://{DOMAINUSERNAME}:{DOMAINPASSWORD}@{DOMAINNAME}:208 2/neomail/neomail.pl"><IMG src="templates/{TEMPLATE}/images/navbar_webmail.jpg" height="26" width="72" border="0"></A></TD>
<td width=100% background="templates/{TEMPLATE}/images/navbar_bg.jpg" align=right valign=middle>
Now, for what I've just written, I got the {DOMAINUSERNAME}, {DOMAINPASSWORD} and {DOMAINNAME} tags from the help link where one edits the invoice form for a particular package. The system's not filling these in properly, but then I guess I didn't really expect them to.
What file would I have to read / edit in order to find the routines where you go pull other tags... so I can write similar routines to go pull these tags and pass them on to that file?
Thanks!
-= Dave Raasch =-
Independence, MO
Alberto
10-14-2003, 02:04 PM
You will not be able to do that sorry, and if you want the template engine to have to go through all the custom fields and parse all the template files that might be a good suggestion, albeit one that might slow down display
DR4296
10-14-2003, 02:20 PM
Great.... so now, when I go "live" with this and tell my customers we're switching from phpmanager over to clientexec, they'll actually get LESS functionality in their menuing system.
phpmanager was great... but their authors had that "phone home" code in the software that would break on THEIR end ever couple of months, thereby disabling all of their customers' copies! So, I could customize their code, but their security system stunk.
With clientexec, I now have code without such crappy security-checks... but customization is limited... and it seems the development in certain areas hasn't quite gotten as far as phpmanager.
Oh well, I guess if I get the time I could take a look at the cookie or session data you set and try to write up some code that will detect the user id based off of that... and then dip back into the database to grab the username, password, and domain.
-= Dave =-
gummyAvenger
10-14-2003, 02:58 PM
Hmm... ok... what if you did something like this (highly experimental):
1) put something like this in clientmenu_home.tpl
<script language="javascript" src="/myjsfunctions.php"></script>
2) create a file in the CE root directory called myjsfunctions.php and put something along the lines of this in it:
<?php
$installdir = dirname($_SERVER['PATH_TRANSLATED']);
if ($installdir==""){
$installdir = dirname($_SERVER['SCRIPT_FILENAME']);
}
$installdir = str_replace("//","/",$installdir);
$installdir = str_replace("\\\\","\\",$installdir);
ini_set("include_path",$installdir);
include_once("config.php");
include_once("common/varDefinitions.php");
?>
function gotocpanelurl() {
var cpanelurl = 'http://' + <?php echo $gSettingsArray["DOMAINUSERNAME"] ?> + ':' + <?php echo $gSettingsArray["DOMAINPASSWORD"] ?> + '@' + <?php echo $gSettingsArray["DOMAINNAME"] ?> + '/cpanel';
window.open(cpanelurl, 'cpanel window');
}
3) then put something like this in clientmenu_home.tpl
<TD><A href="javascript:gotocpanelurl();"><IMG src="templates/{TEMPLATE}/images/navbar_cpanel.jpg" height="26" width="53" border="0"></A></TD>
Now... I would like to stress that this is all higly experimental and untested code. It may need adjusting or it may not work at all.
Also, I'm not sure what the keys are called in $gSettingsArray, so you'll probably have to do a printr($gSettingsArray); to find out. I doubt it'll be DOMAINUSERNAME, etc like in the above code.
Also note that the forum stuck an extra space in the word javascript in that last step.
Anyway... have fun :D
-Daniel
DR4296
10-15-2003, 07:09 AM
Ah! So everything's in $gSettingsArray if I include that variable file, eh?
That's just the sort of info I was looking for! Thanks!
I just wanted to know WHERE to find the darned info... and since so many files appear to have encrypted stuff in them, I figured we weren't allowed access to it.
Thanks very, very much !!
-= Dave =-
gummyAvenger
10-15-2003, 07:37 AM
Ah! So everything's in $gSettingsArray if I include that variable file, eh?
That's just the sort of info I was looking for! Thanks!
I just wanted to know WHERE to find the darned info... and since so many files appear to have encrypted stuff in them, I figured we weren't allowed access to it.
Thanks very, very much !!
-= Dave =-
My pleasure :D
For the most part we're not allowed access to it... however, I found $gSettingsArray in signup.php (which is not encrypted) when I needed it for something I was working on :)
-Daniel
DR4296
10-17-2003, 09:16 AM
gummyAvenger / Daniel,
OK, I just finally got some time freed up to try your code.
In terms of calling the javascript, everything seems to be working fine.
The problem now appears to be with that $gSettingsArray. That appears to call up various hosting-company-related settings. There's nothing in there for users or domains. It all looks like it's Admin Setup stuff.
Things like:
[plugin_offlinecreditcard_Signup Name] => credit card: Mastercard or Visa [plugin_offlinecreditcard_Accept CC Number] => 1 [plugin_offlinecreditcard_Dummy Plugin] => 1 [plugin_offlinecreditcard_Auto Payment] => 0 [plugin_offlinemoneyorder_Plugin Name] => Money Order (offline) [plugin_offlinemoneyorder_In Signup] => 0 [plugin_offlinemoneyorder_Visa] => 0 [plugin_offlinemoneyorder_MasterCard] => 0 [plugin_offlinemoneyorder_AmericanExpress] => 0 [plugin_offlinemoneyorder_Discover] => 0 [plugin_offlinemoneyorder_Signup Name] => money order [plugin_offlinemoneyorder_Accept CC Number] => 0 [plugin_offlinemoneyorder_Dummy Plugin] => 1 [plugin_offlinemoneyorder_Auto Payment] => 0 [plugin_paypal_Plugin Name] => PayPal [plugin_paypal_Visa] => 0 [plugin_paypal_MasterCard] => 0 [plugin_paypal_AmericanExpress] => 0 [plugin_paypal_Discover] => 0 [plugin_paypal_Accept CC Number] => 0 [plugin_paypal_Dummy Plugin] => 0 [plugin_paypal_Auto Payment] => 0 [plugin_paysystems_Plugin Name] => Pay Systems [plugin_paysystems_Visa] => 1 [plugin_paysystems_MasterCard] => 1
Any other recommendations regarding the name of the Array?
Thanks!
-= Dave =-
gummyAvenger
10-17-2003, 10:10 AM
D'oh! Of course it wouldn't be in there.. silly me :rolleyes:
You'll probably have to pull it from the database. The catch is that you'll have to know the client id. From what I can tell, I think the variable for that would be $_REQUEST['frmClientID'].
The information you need is in the domains table in your clientexec database. So, the code might look something like this:
$dbname = "clientexec";
$db = mysql_connect("localhost", "mysql_user", "mysql_password");
mysql_select_db($dbname, $db);
$customerid = $_REQUEST['frmClientID'];
$result = msyql_query("SELECT DomainName, UserName, password FROM domains WHERE CustomerID='$customerid'");
$myrow = mysql_fetch_array($result);
$DomainName = $myrow['DomainName'];
$UserName = $myrow['UserName'];
$password = $myrow['password'];
Note again that this is untested code... but I hope it works for you :)
-Daniel
DR4296
10-17-2003, 12:02 PM
Had to add a few lines to figure out the variable we're looking for:
session_start();
print_r($_SESSION);
Shows me:
Array
(
[sessionAction] => 0
[sessionFuse] => 2
[sessionClientID] => 21
[sessionUserName] => pcgeek
[sessionPassword] => fishhead (not the real password)
)
So, I'm thinking I can just read the session to get the username and password... and get the domain from a database select based on those... I think.
My "test customer" is a guy who has two domains... and I don't quite understand a few things about logging in. I mean, I know I can log in by a specific username and password that's associated with a single domain name.
But, what happens if I try to log in by my customer email address? Should I be using a password for one of the domains? Is the password that gets set up for the customer DIFFERENT from the domain-level passwords?
Guess I'll experiment and see!
Thanks!
-= Dave =-
DR4296
10-17-2003, 01:00 PM
OK, that worked !!
I've done the following:
<?php
$dbname = "dbname";
$db = mysql_connect("localhost", "username", "pass");
mysql_select_db($dbname, $db);
session_start();
$customerid = $_SESSION['sessionClientID'];
$UserName= $_SESSION['sessionUserName'];
$password= $_SESSION['sessionPassword'];
$sql="SELECT DomainName, UserName, password FROM domains WHERE CustomerID='$customerid' and UserName='$UserName' and password='$password'";
$result = mysql_query($sql);
$myrow = mysql_fetch_array($result);
$DomainName = $myrow['DomainName'];
?>
function gotocpanelurl() {
var cpanelurl = 'http://' + '<?php echo $UserName ?>' + ':' + '<?php echo $password ?>' + '@' + '<?php echo $DomainName ?>' + '/cpanel';
window.open(cpanelurl, 'cpanelwindow');
}
function gotoneomailurl() {
var neomailurl = 'http://' + '<?php echo $UserName ?>' + ':' + '<?php echo $password ?>' + '@' + '<?php echo $DomainName ?>' + ':2082/neomail/neomail.pl';
window.open(neomailurl, 'webmail');
}
Works very well, thanks!
Now, if somebody could clarify the difference between logging in by email address and logging in by username... and how that is related to what the user sees in ClientExec, I'd appreciate it!
-= Dave =-
gummyAvenger
10-17-2003, 01:07 PM
Works very well, thanks!
Now, if somebody could clarify the difference between logging in by email address and logging in by username... and how that is related to what the user sees in ClientExec, I'd appreciate it!
Excellent! :D
My understanding is that if you log in via the email address you'll need to use the main password on the account, and if you log in via a domain username, you'll need to use the password for that domain.
...could be wrong, but I'm pretty sure that's how it goes. :)
-Daniel
DR4296
10-18-2003, 04:47 AM
Yeah, I finally found out there was a problem on my end with the username I was trying. But now that that's fixed...
What I've learned is that our dynamically-built-from-javascript links work ONLY if the person logs in with their domain username and password. If they log in with the email account and password, it doesn't work, since there's no single domain name linked with that email address.
I didn't quite grasp until yesterday that all of my customers must now be given an ADDITIONAL password (I haven't gone "live" on clientexec yet). In most cases, this shouldn't be too bad, as I could theoretically just use the password they already have for their primary domain. But if I do that, then I have to somehow remind them that the dynamic links will only work if they log in by domain username.
I guess one fix I could use would be... instead of having the javascript build links... hard-code the links to take them to another full php script of my own making... and have it create links for ALL of the client's domains at once, so as to give them a choice. And I could rig that script to create the links even if they logged in by the overall account email address and password.
But... alas, I don't think I want to do that extra work right now! ;)
Perhaps I'll just rig it so that if our script doesn't detect a username... but instead detects an email address... well, then, have it look up the FIRST domain name for that user and create links from that.
On another note, I'm now trying to figure out how to do something similar... but with the sub-menu for Support. I want to be able to add a couple of hard-coded links to take the clients to my FAQ and my Help Videos page.
Thanks!
-= Dave =-
vBulletin® v3.6.8, Copyright ©2000-2009, Jelsoft Enterprises Ltd.