Changeset 1099
- Timestamp:
- 07/25/03 12:41:30 (21 years ago)
- Location:
- pykota/trunk
- Files:
-
- 1 added
- 11 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pykotme
r1057 r1099 23 23 # 24 24 # $Log$ 25 # Revision 1.2 2003/07/25 10:41:29 jalet 26 # Better documentation. 27 # pykotme now displays the current user's account balance. 28 # Some test changed in ldap module. 29 # 25 30 # Revision 1.1 2003/07/03 09:44:01 jalet 26 31 # Now includes the pykotme utility … … 32 37 import os 33 38 import pwd 34 import grp35 39 36 40 from pykota import version … … 116 120 stream.close() 117 121 122 # get current user 123 uid = os.geteuid() 124 username = pwd.getpwuid(uid)[0] 125 user = self.storage.getUser(username) 126 if user.Exists and user.LimitBy and (user.LimitBy.lower() == "balance"): 127 print _("Your account balance : %.2f") % (user.AccountBalance or 0.0) 128 118 129 printers = self.storage.getMatchingPrinters(options["printer"]) 119 130 if not printers : 120 131 raise PyKotaToolError, _("There's no printer matching %s") % options["printer"] 132 121 133 print _("Job size : %i pages") % nbpages 122 134 for printer in printers : -
pykota/trunk/docs/filterpykota.sgml
r982 r1099 44 44 Currently with a <application>CUPS</application> backend, the <application>pykota</application> filter is used at the very last stage of the print mechanism, 45 45 just before the final data is sent to the printer, but it may eventually be used earlier with some 46 modifications to <application>CUPS</application>'s filtering configuration. This is not tested yet, but this 47 may be the solution to use <application>PyKota</application> with printers which really needs to have 48 a specific filter like <application>magicfilter</application> or <application>cupsomatic</application>, 49 i.e. non-postscript printers. This is a limitation in <application>CUPS</application> which doesn't really 50 allow to specify multiple print filters for different purposes. This problem will be solved in <application>CUPS</application> 51 version 1.2 and higher. 46 modifications to <application>CUPS</application>'s filtering configuration. 47 You can find in the mailing list archives of July 2003 an explanation on how to do this. 48 This may allow you to use PyKota with a not-PostScript printer or with a PostScript printer 49 which really needs to have 50 a specific filter like <application>magicfilter</application> or <application>cupsomatic</application>. 52 51 </para> 53 52 … … 68 67 69 68 <para> 69 When using the <literal>querying</literal> accounting method, 70 70 <application>pykota</application> then asks the printer for its internal page counter, read from the Quota DataBase the internal 71 71 page counter for this printer when the previous job was launched, computes the difference, and report it as the … … 77 77 78 78 <para> 79 When using the <literal>external</literal> accounting method, 80 and if the user is still allowed to print, 81 the command you specified is launched with the job's data on its 82 standard input. Your command must print the job's size in number of 83 pages on a single line on its standard output. This number is then 84 read by PyKota and used to update the current user's quota information. 85 </para> 86 87 <para> 79 88 If a problem occurs, it is logged either to the filter's standard output or to the system logger, depending on 80 89 your preferences in <application>PyKota</application>'s configuration file. Also if a print quota is reached 81 you may choose if the administrator, the user, both or no one will receive an email message explaining90 you may choose if the administrator, the user, both or no-one will receive an email message explaining 82 91 the situation and proposing a solution. 83 92 </para> … … 88 97 89 98 $Log$ 99 Revision 1.5 2003/07/25 10:41:29 jalet 100 Better documentation. 101 pykotme now displays the current user's account balance. 102 Some test changed in ldap module. 103 90 104 Revision 1.4 2003/04/30 20:00:51 jalet 91 105 Typo -
pykota/trunk/docs/installation.sgml
r1052 r1099 116 116 is the case, then the best thing you can do is to ask your <firstterm>Network Administrator</firstterm> 117 117 to not filter the IP port used by <application>PostgreSQL</application>, which is 118 usually port 5432/tcp.118 usually port <literal>5432/tcp</literal>. 119 119 <note> 120 120 <title>Note</title> … … 138 138 have to exist on any system, nor in the Quota DataBase. His default names 139 139 is <literal>pykotaadmin</literal>. 140 A Quota Storage read-only user is also created under the name of <literal>pykotauser</literal>. 141 This read-only user is used by <application>PyKota</application> to connect to the 142 Quota Storage when a non-root user launches a pykota command. This prevents normal 143 users from being able to modify their own, or other users', quota information. 140 144 The database which will be created will be named <literal>pykota</literal> by default. 141 145 <note> … … 177 181 For security reasons, you may want to set passwords in 178 182 <application>PostgreSQL</application> for the 179 <literal>pykotaadmin</literal> user.183 <literal>pykotaadmin</literal> and <literal>pykotauser</literal> users. 180 184 Otherwise any user able to connect to 181 185 <application>PostgreSQL</application> on your Quota Storage Server 182 could connect to the quota database as this user, andmodify it without problem.186 could connect to the quota database, and either see it, or even modify it without problem. 183 187 </para> 184 188 185 189 <para> 186 190 To do so, just type the following lines while still being at the <application>psql</application> 187 prompt (replace the password values by your own ) :191 prompt (replace the password values by your own, and do the same for the <literal>pykotauser</literal> user) : 188 192 <screen> 189 193 pykota=# ALTER USER pykotaadmin PASSWORD 'somepassword'; … … 203 207 take any other step as needed. Please refer to <application>PostgreSQL</application>'s 204 208 documentation for details. Also if <application>PyKota</application>'s configuration 205 file is readable by anyone with access on your file system, a local user could209 file <filename>/etc/pykota/pykotadmin.conf</filename> is readable by anyone with access on your file system, a local user could 206 210 create some script to modify his own print quota. 207 211 <warning> … … 274 278 275 279 <para> 276 Then you have to modify PyKota's configuration file <filename>/etc/pykota.conf</filename> 280 Then you have to modify PyKota's configuration files <filename>/etc/pykota/pykota.conf</filename> 281 and <filename>/etc/pykota/pykotadmin.conf</filename> 277 282 to include LDAP specific options. You may want to give a look at 278 283 <filename>pykota/conf/pykota.conf.sample</filename> to see all the options that are … … 361 366 <listitem> 362 367 <para> 363 MySQLbackend : TODO368 LDAP backend : TODO 364 369 </para> 365 370 </listitem> 366 371 <listitem> 367 372 <para> 368 LDAPbackend : TODO373 MySQL backend : TODO 369 374 </para> 370 375 </listitem> … … 407 412 408 413 $Log$ 414 Revision 1.18 2003/07/25 10:41:29 jalet 415 Better documentation. 416 pykotme now displays the current user's account balance. 417 Some test changed in ldap module. 418 409 419 Revision 1.17 2003/06/30 21:44:18 jalet 410 420 1.09 is out ! -
pykota/trunk/docs/pykota.sgml
r865 r1099 3 3 <!entity INSTALLATION system "installation.sgml"> 4 4 <!entity EDPYKOTA system "edpykota.sgml"> 5 <!entity REPYKOTA system "repykota.sgml"> 6 <!entity PYKOTME system "pykotme.sgml"> 5 7 <!entity WARNPYKOTA system "warnpykota.sgml"> 6 <!entity REPYKOTA system "repykota.sgml">7 8 <!entity FILTERPYKOTA system "filterpykota.sgml"> 8 9 <!entity GNUFDL system "gnufdl.sgml"> … … 86 87 &REPYKOTA; 87 88 89 &PYKOTME; 90 88 91 &WARNPYKOTA; 89 92 … … 95 98 96 99 $Log$ 100 Revision 1.5 2003/07/25 10:41:29 jalet 101 Better documentation. 102 pykotme now displays the current user's account balance. 103 Some test changed in ldap module. 104 97 105 Revision 1.4 2003/03/25 09:32:06 jalet 98 106 Improved documentation. -
pykota/trunk/NEWS
r1095 r1099 22 22 PyKota NEWS : 23 23 24 - 1.14alpha9 : 25 26 - Documentation improved. 27 28 - pykotme now also prints the user's account balance value 29 if the user is registered in the Quota Storage and his 30 limiting factor is "balance". 31 24 32 - 1.14alpha8 : 25 33 -
pykota/trunk/po/en/pykota.po
r1091 r1099 21 21 # 22 22 # $Log$ 23 # Revision 1.33 2003/07/25 10:41:30 jalet 24 # Better documentation. 25 # pykotme now displays the current user's account balance. 26 # Some test changed in ldap module. 27 # 23 28 # Revision 1.32 2003/07/21 23:01:55 jalet 24 29 # Modified some messages aout soft limit … … 410 415 msgstr "" 411 416 417 msgid "Your account balance : %.2f" 418 msgstr "" -
pykota/trunk/po/fr/pykota.po
r1091 r1099 21 21 # 22 22 # $Log$ 23 # Revision 1.32 2003/07/25 10:41:30 jalet 24 # Better documentation. 25 # pykotme now displays the current user's account balance. 26 # Some test changed in ldap module. 27 # 23 28 # Revision 1.31 2003/07/21 23:01:56 jalet 24 29 # Modified some messages aout soft limit … … 420 425 msgstr "Quota d'Impression Bas" 421 426 427 msgid "Your account balance : %.2f" 428 msgstr "Votre solde : %.2f" 429 -
pykota/trunk/po/pykota.pot
r1091 r1099 21 21 # 22 22 # $Log$ 23 # Revision 1.33 2003/07/25 10:41:30 jalet 24 # Better documentation. 25 # pykotme now displays the current user's account balance. 26 # Some test changed in ldap module. 27 # 23 28 # Revision 1.32 2003/07/21 23:01:55 jalet 24 29 # Modified some messages aout soft limit … … 410 415 msgstr "" 411 416 417 msgid "Your account balance : %.2f" 418 msgstr "" -
pykota/trunk/pykota/storages/ldapstorage.py
r1084 r1099 21 21 # 22 22 # $Log$ 23 # Revision 1.20 2003/07/25 10:41:30 jalet 24 # Better documentation. 25 # pykotme now displays the current user's account balance. 26 # Some test changed in ldap module. 27 # 23 28 # Revision 1.19 2003/07/14 14:18:16 jalet 24 29 # Wrong documentation strings … … 664 669 for i in todelete : 665 670 del fields[k][i] 666 if fields.get("objectclass"):671 if "objectclass" in [key.lower() for key in fields.keys()] : 667 672 self.doModify(user.ident, fields, ignoreold=0) 668 673 else : … … 692 697 for i in todelete : 693 698 del fields[k][i] 694 if fields.get("objectclass"):699 if "objectclass" in [key.lower() for key in fields.keys()] : 695 700 self.doModify(group.ident, fields, ignoreold=0) 696 701 else : -
pykota/trunk/pykota/version.py
r1095 r1099 21 21 # 22 22 23 __version__ = "1.14alpha 8_unofficial"23 __version__ = "1.14alpha9_unofficial" 24 24 25 25 __doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""