Proof-reading - fixed one usage of the i18n plural form (it wasn't doing before,...
[kdeadmin.git] / kuser / ku_misc.h
blob7c8e1dd13bfdf38f152cc6ff21c4e562191b34fb
1 /*
2 * Copyright (c) 1998 Denis Perchine <dyp@perchine.com>
3 * Copyright (c) 2004 Szombathelyi György <gyurco@freemail.hu>
4 * Maintained by Adriaan de Groot <groot@kde.org>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public
8 * License version 2 or at your option version 3 as published by
9 * the Free Software Foundation.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 **/
22 #ifndef _KU_MISC_H_
23 #define _KU_MISC_H_
25 #include <sys/time.h>
26 #include <sys/types.h>
29 #include <QByteArray>
31 #include <kldap/ldapoperation.h>
33 bool backup(const QString & name);
34 QByteArray genSalt( int len );
35 QString encryptPass( const QString &pass, bool md5 );
36 time_t now();
37 void copyDir(const QString &srcPath, const QString &dstPath, uid_t uid, gid_t gid);
38 int copyFile(const QString & from, const QString & to);
39 QStringList readShells();
40 void addShell(const QString &shell);
41 int timeToDays(time_t time);
42 time_t daysToTime(int days);
43 void ku_add2ops( KLDAP::LdapOperation::ModOps &ops, const QString &attr, const QList<QByteArray> &vals, bool allownull = false );
44 void ku_add2ops( KLDAP::LdapOperation::ModOps &ops, const QString &attr, const QByteArray &val=QByteArray(), bool allownull = false );
46 #endif // _KU_MISC_H_