Version 1.32.0

Released: 2008-05-26

Monthly history for complete usage stats (SKINS) (new files) new

Monthly history for complete usage stats.

Similar to Reseller History and User History, but for entire server.

Creates the following file when an Admin is reset:

/usr/local/directadmin/data/admin/admin.hist

SKINS:

admin/show_history.html (see skin for details)

lang/en/admin/show_history.html (for enhanced skin, see skin for details)

files_admin.conf:

CMD_ADMIN_HISTORY=admin/show_history.html

restore default DNS settings tool (SKINS) new

Tool for users or admins to restore the default dns settings for their zone, should they manage to botch it up enough past fixability. It would wipe any custom entries as well, fyi.

Accessed via CMD_DNS_ADMIN only. (Admins Only)

The values that this will reset to will be retrieved from the user.conf file (ip, ns1, ns2) where the user for the domain is retrieved from /etc/virtual/domainowners. Subdomains are also re-added.

If this is a non-user domain (ie: added manually through the DNS Admin) then it will defaults to your server IP and the ns1/ns2 values from the directadmin.conf

SKINS:

admin/dns_admin_control.html

added a button, buttom left, (opposite of 'delete selected') called "Reset Defaults".

Button code:

<input type=submit value='|LANG_RESET_DEFAULTS|' name=reset onClick="return confirm('|LANG_RESET_WARNING|');">

language files need to be updated as well:

LANG_RESET_DEFAULTS=Reset Defaults
LANG_RESET_WARNING=WARNING: Resetting the defaults will wipe any custom entries you have made.

If you want to call this via CMD_API_DNS_ADMIN, the info is:

CMD_API_DNS_ADMIN
method: POST
domain=domain.com
reset=anything
action=select

CMD_API_EDIT_USER_MESSAGE new

CMD_API_EDIT_USER_MESSAGE

Calling this without passing any data will return 2 url encoded values:

message

subject

To save data, use the same command, but:

Method: POST
subject=the subject
message=the message
save=Save (any value will work)

To reset the data to the defaults (wipe what you wrote), use:

Method: POST
subject=the subject
message=the message
reset=Reset (any value will work)

Ability to hide the number of users on an IP as seen by a Reseller new

When a reseller view's his IPs via "IP Assignment", it will show him how many users are on a shared IP. This option will hide this number from him.

add the following to your directadmin.conf, then restart DA:

hide_ip_user_numbers=1

default is 0 internally to DA. (if the option is not present)

change ftp_list.php to use ncftpls instead of php new

Since the php ftp parsers we wrote is likely one of the most incompatible ftp file list parsers around, we've opted to avoid further headaches and swith to ncftpls instead, since it's very compatible, reliable, and everyone has it.

New ftp_list.php code:
/bin/sh

FTPLS=/usr/bin/ncftpls
TMPDIR=/home/tmp
PORT=21

if [ ! -e $FTPLS ]; then
        echo "";
        echo "*** Unable to get list ***";
        echo "Please install $FTPLS by running:";
        echo "";
        echo "cd /usr/local/directadmin/scripts";
        echo "./ncftp.sh";
        echo "";
        exit 10;
fi

RANDNUM=`/usr/local/bin/php -r 'echo rand(0,10000);'`
#we need some level of uniqueness, this is an unlikely fallback.
if [ "$RANDNUM" = "" ]; then
        RANDNUM=$ftp_ip;
fi

CFG=$TMPDIR/$RANDNUM.cfg
rm -f $CFG
touch $CFG
chmod 600 $CFG
echo "host $ftp_ip" >> $CFG
echo "user $ftp_username" >> $CFG
echo "pass $ftp_password" >> $CFG

DUMP=$TMPDIR/$RANDNUM.dump
rm -f $DUMP
touch $DUMP
chmod 600 $DUMP

$FTPLS -l -f $CFG -P ${PORT} -t 25 "ftp://${ftp_ip}${ftp_path}" 2>&1 > $DUMP
$RET=$?

if [ "$RET" -ne 0 ]; then
        cat $DUMP
else
        cat $DUMP | grep -v -e '^d' | awk '{ print $9; }'
fi

rm -f $CFG
rm -f $DUMP

exit $RET

Optimize, repair and check mysql databases. new

Buttons added to mysql databases page for optimizing, repairing and checking mysql databases.

Form changes to CMD_DB:

action=delete

in the table has been changed to:

action=select

Note that this is backwards compatible for any API people, so no need to rewrite all your code.

The delete button will pass delete_db=Delete which is now how DA will tell what action is being used. The other buttons will have similar names to specify what it's doing.

public_html directory can't be removed on user suspend. fixed

With the change to a /home/user/public_html directory instead of a symbolic link, the suspending of user accounts can no longer use the "unlink" command, since it's a folder with contents.

Related error:

Error Deleting ~/public_html symbolic link: The filesystem does not allow unlinking of files.

This fix also changes the backup/restore:

backups no longer include /home/user/public_html in the home.tar.gz

restores will delete the /home/user/public_html (link or dir) before a home.tar.gz extraction.

Workaround:

add the following to your directadmin.conf:

old_public_html_link=1

and restart DA.

Once DA is restarted, go to:

User Level -> Domain Setup -> select the main domain and click "set as default".

This will reset the public_html link instead of the directory.

Related:

~username/domain.com as default

chgrp squirrelmail data to webapps for new accounts fixed

For new email accounts, DA creates a .pref file chowned to apache:apache.

This change will have it create the account as apache:webapps, chmod 660. If the webapps group doesn't exist, it uses apcahe:apache.

This is needed if you're running suPhp.

For a workaround until this release create:

/usr/local/directadmin/scripts/custom/email_create_post.sh

Fill it with:

#!/bin/sh

FILE=/var/www/html/squirrelmail/data/${user}\\@${domain}.pref
chown apache:webapps $FILE
chmod 660 $FILE
exit 0;

Then chmod the email_create_post.sh to 755.

Remove A records from dns merge if same name CNAME exists in backup. fixed

When restoring from a backup, DirectAdmin will merge the live zone with the backup, creating a merged zone to overwrite the other 2.

This fix will examine the merged pile.. and check for any A records in the merged pile that also exist in the backups CNAME pile. The assumption is that all CNAME are manually created (since we don't create any default CNAMES) so it's most likely that the user will rather have the CNAME than the default A record. This is the assumption, which may not apply to all cases. BUT seeing how having the same A and CNAME record will kill the entire zone anyway and make everything totally unresolved, then this is better than that.

Apache handlers for "system" with custombuild is an empty list fixed

The system apache handlers show an empty list if you have custombuild, because DA is parsing through the wrong file (direcatdmin-vhosts.conf instead of httpd.conf and extra/*.conf)

Fix is to parse both files all the time and overlap won't hurt.

optimized "show reseller" page to use show_all_users.cache fixed

Admin Level -> List Resellers -> resellername

eg:

CMD_SHOW_RESELLER?user=reseller

Has been optimized to now use the show_all_users.cache.

Previously, the entire list of was geneated on the fly.

A client with over 7000 users had difficulty loading the page 😉

It will speed it up greatly for everyone, even if you don't have that many users.

Also, for all reseller loads, the users.list read-in has been changed to do an optimized read in as well. The optimization will greatly speed things up, but will not longer remove duplicate usernames, if they happen to get into that pile (not sure how they would, but if they do, there could be the same name more than once and the read-in wouldn't filter that out)

The apache owne files disk usage total was counting non-apache directories fixed

The directory size checker has the ability to run for "all" data or just owned owned by a specific user. During the tally, this tool is used to count all files under a users home directory that may be owned by the apache user. The "files within a directory" portion of this count was working correctly, but the run was always counting directory filesizes (4096 bytes) even when in apache-user mode if the directory wasn't owned by apache. (This only applies to the directory itself, and not it's contents)

This doesn't impact disk usage much for those with a small handlful of folders which is why it hasn't been noticed until now. But for anyone with thousands of directories, the 4096 bytes x thousands of directories would add up quickly.

This fix simply excludes the folders if they're not owned by the given user if the directory size count tool was called in the specific-user mode, as it shoud have been doing.

This will likely also make counting slightly more accurate in other areas that use this tool.

Last Updated: