Net2ftp integration.

Discussion in 'Tips/Tricks/Mods' started by vsevolod, Jan 11, 2010.

  1. mirk67

    mirk67 New Member

    I had installed ISPConfig-3.0.1.6 and after net2ftp

    and site page blank

    I have now removed 3.0.1.6 version

    and installed 3.0.2.1

    for insert net2ftp in ISPConfig-3.0.2.1

    which guide should I follow?
     
  2. rocker2344

    rocker2344 New Member

    i did everything stated for ubuntu 9.10
    i am running 10.04 and ispconfig 3.0.3.2
    and it is not showing..... help!?!?
     
  3. Cronner

    Cronner New Member

    Shows up just fine, but need it to put in the domain clicked, instead of server url or else the installer cannot provide correct links, anyone provide info for that?
    Also icon does not work here :(
     
    Last edited: Feb 1, 2011
  4. teoverton

    teoverton New Member

    Is this how-to still valid?

    Does anyone know...
    Is this how-to still valid for the latest versions of sipconfig and net2ftp. I am running a new web-host based on ispconfig3 and would like to integrate this if they are still playing well together.

    Thanks
    Thomas
     
  5. endebe

    endebe New Member

    Only works for main domain

    In this php script it only works for the master domain.
    I've different domains hosted on my server, but i'm not good con sql :(
    Anybody could give me a hint for the right way, so anybody connects to his domain, and not to my domain?
    Thanks
    Best regards, endebe
    PHP:
    <?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);
    header('location:/webftp?servername="'.$serverData['server_name'].'"');
    exit;
    ?>
    follow the next post for my solution
     
    Last edited: Oct 28, 2012
  6. endebe

    endebe New Member

    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:
    <?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:
            <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:
    <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:
    	/* 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: Oct 28, 2012
  7. Instructions for 3.0.5 and Debian?

    Can someone list the instructions for how to integrate this with the current version 3.0.5? I am struggling to get it to work with Debian Squeeze. Thanks in advance.
     
  8. craig baker

    craig baker Member HowtoForge Supporter

    net2ftp integration broken!

    alas, the current version of ISPCONFIG breaks the instructions given here - among other things the content_ispxxxx file no longer exists.

    has anyone got net2ftp integrated with ISPCONFIG 3.05?
     
  9. IKShadow

    IKShadow New Member

    I would like to know that as well :)
     
  10. flooster

    flooster New Member

    Hi I installed Net2ftp with the script. The webftp works well but 2 problems i have, I could not unzip and upload files.

    1) If try to upload, but there is an error:

    "Could not generate a temporary file."

    Technical info:
    The error occured in file /var/www/webftp/includes/filesystem.inc.php on line 1773.
    function acceptFiles (/var/www/webftp/modules/upload/upload.inc.php on line 248)
    argument 0: Array
    function net2ftp_module_printBody (/var/www/webftp/main.inc.php on line 313)
    function net2ftp (/var/www/webftp/index.php on line 61)
    argument 0: printBody


    2) and another, if I want to unzip the zip file, there is another problem:

    Unable to get the archive reinstal serveru.zip from the FTP server

    Is here someone who can help me please. I dont know what to do with that.

    THX a loooooot :)

    I Have ISPConfig 3.0 and Debian 6.0
     
  11. ferra

    ferra Member

    Hi, I'm running ISPConfig 3.0.5.3, and still cannot integrate net2ftp into it. I have net2ftp running on the same server.
    Anu news about this, or any other solution?

    Thanks
     
  12. Quaxth

    Quaxth Member

    WinSCP

    I've to admit that I'm new to Linux and also ISPConfig, therefore please read my comments with care and don't take it as advice or some like that!

    As many other user's, I do believe, I'm missing the File Manager/Explorer too. For what I plan to use IPSConfig for, I even wouldn't grant access to an File Manager/Explorer to the users.

    Because of solving some other problems, Till was suggesting the Desktop Apps WinSCP to use for to copy files from Server to PC, for what reason ever. That was working great!

    Now reading about the File Manager/Explorer, I was take a closer look at WinSCP again for to maybe use to copy files from and to the User space. It seems to be that those could be done with WinSCP, just look under /var/www/ on the server (I use Debian Wheezy) and you'll find the Domain Directories of Users with access to all files on it.

    With WinSCP all file operation seems to be could be done include editing of files. Ok, that would be for Administrators only who've access by SSH to the root of the server.

    By the way, WinSCP is working a bit similar like PuTTY but with GUI include Menu's and like Norton Commander, which makes it very easy to use:

    [​IMG]

    WinSCP is freeware and could downloaded from: http://winscp.net/eng/index.php

    Caution: Please keep in mind that what you do, you do it totally at your own risk!
     
  13. ferra

    ferra Member

    Yes WinSCP is a great tool, but is only for windows. In my opnion, the world is going mobile and we have to give the users the most user friendly and pratical tools we can. Everything must be on the browser without the need to install applications on the pc or tablet. So the need for a tool like net2ftp has is place in the way that from any browser I can start work on my files/site. The easy integration of tools like this one will give to ISPConfig a richer piece of software.
     
  14. Quaxth

    Quaxth Member

    That's mainly right!

    But I wouldn't say at the moment and even not for the next close future that those ad-on apps should be for mobile use only! They should also be for normal, means Desktop, use too.

    That said, I wouldn't deny that apps like net2ftp are not needed! They are needed too and if we didn't close our eye's for what is need today and the near future, we've to realize that there's also still the need for the older "way"!

    Developers have to take in account that the changes are maybe not always welcomed if they are pushed to fast. There many factors involve, something what many times is just simply forgotten by developers. Still, the majority for now and the near future using desktop systems for real work instead of mobile systems.

    While say that, didn't think that I'm against that move, I'm not. I use Tablet computer quite a few years for work where it's possible. I'm not someone who's using his mobile device for play games, music etc. as the majority of mobile device owners do! On the other hand I'm working mainly with customers and their employees as Service Consultant and outsourced contractor for LAN and AS400 and could see what those users really have for need's!
     
  15. ferra

    ferra Member

    well, I have net2ftp running from ISPConfig, but still need to fill the ftp server, username and password. is there a way when i click on the net2ftp icon to go with all the information to login?

    My configurations files:
    Versions: ubuntu 12.04.3 LTS, ISPConfig 3.0.5.3, net2ftp v1.0

    /usr/local/ispconfig/interface/web/sites/ftp_user_net2ftp.php
    /*
    * We only redirect to the login-form, so there is no need, to check any rights
    */
    if($global_config['webftp_url'] != '') {
    $net2ftp_url = $global_config['webftp_url'];
    $net2ftp_url = str_replace(array('[SERVERNAME]', '[USERNAME]'),array($serverData['server_name'], $ftpUserData['database_name']),$net2ftp_url);
    header('Location: '.$net2ftp_url);
    } else {
    isset($_SERVER['HTTPS'])? $http = 'https' : $http = 'http';
    if($web_config['server_type'] == 'nginx') {
    header('Location: http://' . $serverData['server_name'] . ':8080/net2ftp');
    } else {
    header('Location: ' . $http . '://' . $serverData['server_name'] . ':8080/net2ftp');
    }
    }

    exit;
    ?>

    /usr/local/ispconfig/interface/web/sites/templates/ftp_user_list.htm
    <td class="tbl_col_buttons">
    <a class="button icons16 icoDbAdmin" href="sites/ftp_user_net2ftp.php?id={tmpl_var name='id'}" target="net2ftp"><span>{tmpl_var name='admin_txt'}</span></a>
    <a class="button icons16 icoDelete" href="javascript: del_record('sites/ftp_user_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>



    /etc/apache2/conf.d/webftp.conf

    Alias /net2ftp /var/www/webftp
    Alias /webftp /var/www/webftp
    <Directory /var/www/webftp>
    Options +FollowSymLinks
    # DirectoryIndex index.php
    AllowOverride All
    order allow,deny
    allow from all
    <IfModule mod_php5.c>
    AddType application/x-httpd-php .php
    php_flag magic_quotes_gpc Off
    php_flag track_vars On
    php_flag register_globals Off
    php_admin_flag allow_url_fopen Off
    php_value include_path .
    php_admin_value upload_tmp_dir /var/www/webftp/temp
    php_admin_value open_basedir /var/www/webftp
    </IfModule>

    </Directory>


    /var/www/ispconfig/sites/site_webftp.php

    <?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;
    ?>

    /var/www/ispconfig/sites/templates/web_domain_list.htm

    <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><a href="http://{tmpl_var name="domain"}" target="_blank" class="button icons16 icoLink"><span>Link</span></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="button 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>
    <tmpl_unless name="records">
    <tr class="tbl_row_noresults tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>">
    <td colspan="5">{tmpl_var name='globalsearch_noresults_text_txt'}</td>
    </tr>
    </tmpl_unless>
    </tbody>


    /var/www/ispconfig/sites/templates/web_domain_admin_list.htm

    <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><a href="http://{tmpl_var name="domain"}" target="_blank" class="button icons16 icoLink"><span>Link</span></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="button 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>
    <tmpl_unless name="records">
    <tr class="tbl_row_noresults tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>">
    <td colspan="6">{tmpl_var name='globalsearch_noresults_text_txt'}</td>
    </tr>
    </tmpl_unless>
    </tbody>



    Any idea?
     
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    ftp server and user should be possible, but not the password. If you would like to fill in the password, it would have to be stored unencrypted or encrypted reversibly in the db and that would be a huge security hole.
     
  17. ferra

    ferra Member

    Ok, thanks, for the username what is missing?
     
  18. till

    till Super Moderator Staff Member ISPConfig Developer

    The username of a ftp user is stored in the ftp_user table. If you want to use it in your scripts, you will have to read the infrmation from there. Regarding the server name, the ftp_user table has a server id, you can use this ID to lookup the hostname of the server in the "server" database table.
     
  19. FlipStonE

    FlipStonE New Member

    nginx

    Can this guide work on the perfect server setup but with nginx instead of apache2?
     

Share This Page