The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

general question

Discussion in 'Database Discussions' started by davestacey, Nov 10, 2005.

  1. davestacey

    davestacey Member

    Joined:
    Nov 10, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    instead of giving my customers access to cpanel, is it possible to take 2 cpanel features and intergrate them into an admin area?

    www.domain.com/admin

    The 2 options i would like to intergrate into the admin area are: email & stats



    any ideas how i could achieve this please?

    Thanks
    Dave
     
  2. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    You have the option of giving your clients access to the CPanel with email only. If you need to add more, then you have to create your own theme.
     
  3. antodeepak

    antodeepak Active Member

    Joined:
    Jan 24, 2005
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    kerala, India
    Hi

    Hi buddy,

    You can make your clients view the webstats without login into the cpanel. You can configure it with the following steps.

    The following commands help to access the webalizer without login the Cpanel
    cd /home/username/www
    ln -s ../tmp/webalizer stats
    chown username.username stats
    cd ../tmp
    chmod 755 ./
    chmod 755 ./webalizer

    will allow domain.com/stats/ for viewing stats without logging in to cpanel

    But I am not much condident in answering the "email" qst :) as I didn't understand what you are asking for...

    Thanks & Regards,
    Anto :cool:
     
  4. fikse

    fikse Well-Known Member

    Joined:
    May 10, 2003
    Messages:
    112
    Likes Received:
    0
    Trophy Points:
    16
    have you tried using the feature manager? you can create groups of accounts and restrict which options show up inside their control panel....


    "The feature manager allows you to disable/enable features inside of each users cPanel. Once you build a feature list you should edit the package you wish to assign it to and add the feature list. "

    .
     
  5. davestacey

    davestacey Member

    Joined:
    Nov 10, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Many thanks for your replies!

    antodeepak has hit the nail on the head, i want to show my customers webstats without logging in to cpanel. so his resolution should take care of that.

    and for the email question i had, its the same question as the stats one.


    can i offer my customers the chance to add/remove email accounts without logging in to cpanel? via a seperate admin (e.g: is there a script or something that will connect to cpanel [using a configure.php or something] and then allow customers to add/remove email accounts / forwarders)

    is it the same sort of method as the stats method?



    p.s: i have created a complex admin area for my customers, using php/SQL, and have been developing it for a year now, the last thing to add to it is email function and web stats. Thats why i dont want to use cpanel.
     
    #5 davestacey, Nov 12, 2005
    Last edited: Nov 12, 2005
  6. antodeepak

    antodeepak Active Member

    Joined:
    Jan 24, 2005
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    kerala, India
    :) Hi,

    Hi buddy,

    Seems that we can work out the issue with email. But Have to investigate a further for that. You can wirte a script that helps for adding a pop account and can integrate it with the php/sql script. But there will be a issue. You have to particularly assign the quota for email accounts with the script. Hope you got me. Please try to check out with writing a script. If you get any thread with that, please update with the posting. So that It will be helpful everybody.

    Thanks for your care and support.

    Anto ;)
     
    #6 antodeepak, Nov 13, 2005
    Last edited: Nov 13, 2005
  7. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    i have a script that manages cpanel mail accounts and quotas using a database table and php web pages

    its a rough script but it works for what i need
    I run it on a cronjob and it removes and rewrites the auth files for the e-mail accounts on a set schedule

    #!/usr/bin/perl

    use DBI;
    use Crypt::DES;

    my $dbh = DBI->connect("DBI:mysql:database:<hostname>", "dbuser", "dbpassword");

    my $passwd="/home/<accountname>/etc/<domainname>/passwd";
    my $shadow="/home/<accountname>/etc/<domainname>/shadow";
    my $quota="/home/<accountname>/etc/<domainname>/quota";

    sub encrypt_password
    {
    my $unencrypted_string = shift @_;
    my @salt_chars = ('a'..'z','A'..'Z','0'..'9');
    my $salt = "\$1\$" . $salt_chars[rand(63)] . $salt_chars[rand(63)] . "\$";
    return crypt($unencrypted_string, $salt);
    }


    my $sql_email = <<ENDSQL;
    select email,password from database order by email
    ENDSQL
    my $sth_email = $dbh->prepare($sql_email);


    open(DAT,">$passwd") || die("Cannot Open File");
    close(DAT);
    open(DAT,">$shadow") || die("Cannot Open File");
    close(DAT);
    open(DAT,">$quota") || die("Cannot Open File");
    close(DAT);

    $sth_email->execute();
    while ($hash = $sth_email->fetchrow_hashref)
    {
    $email = $hash->{email};
    $pass = $hash->{password};
    my $crypt = &encrypt_password($pass);
    open(DAT,">>$passwd") || die("Cannot Open File");
    print DAT "${email}:x:32046:32047::/home/<accountname>/mail/<domainname>/${email}:/usr/local/cpanel/bin/noshell\n";
    close(DAT);

    open(DET,">>$shadow") || die("Cannot Open File");
    print DET "${email}:${crypt}:::::::\n";
    close(DET);

    open(DQT,">>$quota") || die("Cannot Open File");
    print DQT "${email}:10485760\n";
    close(DQT);
    }

    $dbh->disconnect;

    $cnt = chown 32046,12,'${passwd}','${shadow}','${quota}';
    chown $uid, $gid, @filenames;
     
  8. emechanic

    emechanic Member

    Joined:
    Aug 27, 2004
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    webignition wrote up a tutorial on how to write scripts for remote access. its pretty good and should fit the bill on how to setup functions in a seperate area(different controlpanel)

    help if i added the address lol

    http://forums.cpanel.net/showthread.php?t=46362
     
Loading...

Share This Page