View Single Post
  #26  
Old 28th October 2012, 19:12
endebe endebe is offline
Junior Member
 
Join Date: Apr 2008
Posts: 2
Thanks: 2
Thanked 0 Times in 0 Posts
Exclamation Solution for the domains

Ok, i tried with phpmywebadmin.
I got the solution

The code, which works fine for hosted domains:
/var/www/ispconfig/sites/site_webftp.php
PHP Code:
<?php
require_once('../../lib/config.inc.php');
require_once(
'../../lib/app.inc.php');
$app->auth->check_module_permissions('sites');
if (!isset(
$_GET['id'])){
die (
"No site selected!");
}
$domainId intval($_GET['id']);
$dbData $app->db->queryOneRecord("SELECT server_id FROM web_domain WHERE domain_id = " $domainId);
$serverId intval($dbData['server_id']);
if (
$serverId == 0){
die (
"No Server found!");
}
$serverData $app->db->queryOneRecord(
//"SELECT server_name FROM server WHERE server_id = " . $serverId);
"SELECT domain FROM web_domain WHERE domain_id = " .$domainId);
//header('location:/webftp?servername="'.$serverData['server_name'].'"');
header('location:/webftp?servername="'.$serverData['domain'].'"');
exit;
?>
i also want for me, as admin of my server, to connect to the right hosted domains.
So for i've modified this one also:
/var/www/ispconfig/sites/templates/web_domain_admin_list.htm
HTML Code:
        <tbody>
          <tmpl_loop name="records">
          <tr class="tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>">
            <td class="tbl_col_domain_id"><a href="#" onClick="loadContent('sites/web_domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="domain_id"}</a></td>
            <td class="tbl_col_active"><a href="#" onClick="loadContent('sites/web_domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="active"}</a></td>
            <td class="tbl_col_sys_groupid"><a href="#" onClick="loadContent('sites/web_domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="sys_groupid"}</a></td>
            <td class="tbl_col_server_id"><a href="#" onClick="loadContent('sites/web_domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="server_id"}</a></td>
            <td class="tbl_col_domain"><a href="#" onClick="loadContent('sites/web_domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="domain"}</a></td>
            <td class="tbl_col_buttons">
              <div class="buttons icons16">
              	<a class="icons16 icoWebFTP" href="sites/site_webftp.php?id={tmpl_var name='id'}" target="webftp"><span>{tmpl_var name='admin_txt'}</span></a>
                <a class="icons16 icoDelete" href="javascript: del_record('sites/web_domain_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span>{tmpl_var name='delete_txt'}</span></a>
              </div>
            </td>
          </tr>
          </tmpl_loop>
        </tbody>
The formerly changes are:
/var/www/ispconfig/sites/templates/web_domain_list.htm
HTML Code:
<tbody>
          <tmpl_loop name="records">
          <tr class="tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>">
            <td class="tbl_col_domain_id"><a href="#" onClick="loadContent('sites/web_domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="domain_id"}</a></td>
            <td class="tbl_col_active"><a href="#" onClick="loadContent('sites/web_domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="active"}</a></td>
            <td class="tbl_col_server_id"><a href="#" onClick="loadContent('sites/web_domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="server_id"}</a></td>
            <td class="tbl_col_domain"><a href="#" onClick="loadContent('sites/web_domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="domain"}</a></td>
            <td class="tbl_col_buttons">
              <div class="buttons icons16">
              	<a class="icons16 icoWebFTP" href="sites/site_webftp.php?id={tmpl_var name='id'}" target="webftp"><span>{tmpl_var name='domain'}</span></a>
                <a class="icons16 icoDelete" href="javascript: del_record('sites/web_domain_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span>{tmpl_var name='delete_txt'}</span></a>
              </div>
            </td>
          </tr>
          </tmpl_loop>
        </tbody>
and the css file at
/var/www/ispconfig/themes/default/css/screen/content_ispc.css
HTML Code:
	/* Button with icon and without text */
	.icons16 span { display: none; }
	a.icons16 { height: 18px; width: 18px; padding: 0; background-repeat: no-repeat; background-position: 1px 1px;}
	button.icons16 { height: 20px; width: 20px; padding: 0; background-repeat: no-repeat; background-position: 1px 1px;}

	.icons16.icoDelete { background-image: url("../../icons/x16/minus_circle_frame.png"); }
	.icons16.icoFilter { background-image: url(../../icons/x16/funnel.png); }
	.icons16.icoEdit { background-image: url("../../icons/x16/wrench.png"); }
	.icons16.icoDbAdmin { background-image: url("../../icons/x16/database.png"); }
	.icons16.icoLoginAs { background-image: url("../../icons/x16/user_go.png"); }
	.icons16.icoWebmailer { background-image: url("../../icons/x16/mails_arrow.png"); }
	.icons16.icoWebFTP { background-image: url("../../icons/x16/folder_open.png"); }
With this all, it works perfect for me now. Also for my clients.
They get now:

httpx://www.ispservername.com:8080/webftp/?servername="hosted-domainname.com"


Furthermore i think it would be a nice idea, include this, with some "if then else" in the normal ISPC3 Package. It's not very difficult, i think.

Last edited by endebe; 28th October 2012 at 19:18. Reason: wishlist: maybe someone could create a "all in one package" for ISPC3?
Reply With Quote