Changeset 1099

Show
Ignore:
Timestamp:
07/25/03 12:41:30 (21 years ago)
Author:
jalet
Message:

Better documentation.
pykotme now displays the current user's account balance.
Some test changed in ldap module.

Location:
pykota/trunk
Files:
1 added
11 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pykotme

    r1057 r1099  
    2323# 
    2424# $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# 
    2530# Revision 1.1  2003/07/03 09:44:01  jalet 
    2631# Now includes the pykotme utility 
     
    3237import os 
    3338import pwd 
    34 import grp 
    3539 
    3640from pykota import version 
     
    116120                stream.close() 
    117121                 
     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             
    118129        printers = self.storage.getMatchingPrinters(options["printer"]) 
    119130        if not printers : 
    120131            raise PyKotaToolError, _("There's no printer matching %s") % options["printer"] 
     132             
    121133        print _("Job size : %i pages") % nbpages     
    122134        for printer in printers : 
  • pykota/trunk/docs/filterpykota.sgml

    r982 r1099  
    4444    Currently with a <application>CUPS</application> backend, the <application>pykota</application> filter is used at the very last stage of the print mechanism, 
    4545    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>. 
    5251  </para> 
    5352   
     
    6867   
    6968  <para> 
     69    When using the <literal>querying</literal> accounting method, 
    7070    <application>pykota</application> then asks the printer for its internal page counter, read from the Quota DataBase the internal 
    7171    page counter for this printer when the previous job was launched, computes the difference, and report it as the  
     
    7777   
    7878  <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> 
    7988    If a problem occurs, it is logged either to the filter's standard output or to the system logger, depending on 
    8089    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 noone will receive an email message explaining 
     90    you may choose if the administrator, the user, both or no-one will receive an email message explaining 
    8291    the situation and proposing a solution. 
    8392  </para> 
     
    8897 
    8998$Log$ 
     99Revision 1.5  2003/07/25 10:41:29  jalet 
     100Better documentation. 
     101pykotme now displays the current user's account balance. 
     102Some test changed in ldap module. 
     103 
    90104Revision 1.4  2003/04/30 20:00:51  jalet 
    91105Typo 
  • pykota/trunk/docs/installation.sgml

    r1052 r1099  
    116116        is the case, then the best thing you can do is to ask your <firstterm>Network Administrator</firstterm> 
    117117        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>. 
    119119        <note> 
    120120          <title>Note</title> 
     
    138138        have to exist on any system, nor in the Quota DataBase. His default names 
    139139        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. 
    140144        The database which will be created will be named <literal>pykota</literal> by default. 
    141145        <note> 
     
    177181        For security reasons, you may want to set passwords in  
    178182        <application>PostgreSQL</application> for the  
    179         <literal>pykotaadmin</literal> user. 
     183        <literal>pykotaadmin</literal> and <literal>pykotauser</literal> users. 
    180184        Otherwise any user able to connect to  
    181185        <application>PostgreSQL</application> on your Quota Storage Server  
    182         could connect to the quota database as this user, and modify it without problem.  
     186        could connect to the quota database, and either see it, or even modify it without problem.  
    183187      </para> 
    184188       
    185189      <para> 
    186190        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) : 
    188192        <screen> 
    189193pykota=# ALTER USER pykotaadmin PASSWORD 'somepassword'; 
     
    203207        take any other step as needed. Please refer to <application>PostgreSQL</application>'s 
    204208        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 could  
     209        file <filename>/etc/pykota/pykotadmin.conf</filename> is readable by anyone with access on your file system, a local user could  
    206210        create some script to modify his own print quota. 
    207211        <warning> 
     
    274278       
    275279      <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> 
    277282        to include LDAP specific options. You may want to give a look at  
    278283        <filename>pykota/conf/pykota.conf.sample</filename> to see all the options that are 
     
    361366              <listitem> 
    362367                <para> 
    363                   MySQL backend : TODO 
     368                  LDAP backend : TODO 
    364369                </para> 
    365370              </listitem> 
    366371              <listitem> 
    367372                <para> 
    368                   LDAP backend : TODO 
     373                  MySQL backend : TODO 
    369374                </para> 
    370375              </listitem> 
     
    407412 
    408413$Log$ 
     414Revision 1.18  2003/07/25 10:41:29  jalet 
     415Better documentation. 
     416pykotme now displays the current user's account balance. 
     417Some test changed in ldap module. 
     418 
    409419Revision 1.17  2003/06/30 21:44:18  jalet 
    4104201.09 is out ! 
  • pykota/trunk/docs/pykota.sgml

    r865 r1099  
    33  <!entity INSTALLATION system "installation.sgml"> 
    44  <!entity EDPYKOTA system "edpykota.sgml"> 
     5  <!entity REPYKOTA system "repykota.sgml"> 
     6  <!entity PYKOTME system "pykotme.sgml"> 
    57  <!entity WARNPYKOTA system "warnpykota.sgml"> 
    6   <!entity REPYKOTA system "repykota.sgml"> 
    78  <!entity FILTERPYKOTA system "filterpykota.sgml"> 
    89  <!entity GNUFDL system "gnufdl.sgml"> 
     
    8687  &REPYKOTA; 
    8788     
     89  &PYKOTME;   
     90   
    8891  &WARNPYKOTA; 
    8992     
     
    9598 
    9699$Log$ 
     100Revision 1.5  2003/07/25 10:41:29  jalet 
     101Better documentation. 
     102pykotme now displays the current user's account balance. 
     103Some test changed in ldap module. 
     104 
    97105Revision 1.4  2003/03/25 09:32:06  jalet 
    98106Improved documentation. 
  • pykota/trunk/NEWS

    r1095 r1099  
    2222PyKota NEWS : 
    2323 
     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           
    2432    - 1.14alpha8 : 
    2533     
  • pykota/trunk/po/en/pykota.po

    r1091 r1099  
    2121# 
    2222# $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# 
    2328# Revision 1.32  2003/07/21 23:01:55  jalet 
    2429# Modified some messages aout soft limit 
     
    410415msgstr "" 
    411416 
     417msgid "Your account balance : %.2f" 
     418msgstr "" 
  • pykota/trunk/po/fr/pykota.po

    r1091 r1099  
    2121# 
    2222# $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# 
    2328# Revision 1.31  2003/07/21 23:01:56  jalet 
    2429# Modified some messages aout soft limit 
     
    420425msgstr "Quota d'Impression Bas" 
    421426 
     427msgid "Your account balance : %.2f" 
     428msgstr "Votre solde : %.2f" 
     429 
  • pykota/trunk/po/pykota.pot

    r1091 r1099  
    2121# 
    2222# $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# 
    2328# Revision 1.32  2003/07/21 23:01:55  jalet 
    2429# Modified some messages aout soft limit 
     
    410415msgstr "" 
    411416 
     417msgid "Your account balance : %.2f" 
     418msgstr "" 
  • pykota/trunk/pykota/storages/ldapstorage.py

    r1084 r1099  
    2121# 
    2222# $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# 
    2328# Revision 1.19  2003/07/14 14:18:16  jalet 
    2429# Wrong documentation strings 
     
    664669                    for i in todelete : 
    665670                        del fields[k][i] 
    666             if fields.get("objectclass") :             
     671            if "objectclass" in [key.lower() for key in fields.keys()] :             
    667672                self.doModify(user.ident, fields, ignoreold=0)         
    668673            else :     
     
    692697                    for i in todelete : 
    693698                        del fields[k][i] 
    694             if fields.get("objectclass") :             
     699            if "objectclass" in [key.lower() for key in fields.keys()] :             
    695700                self.doModify(group.ident, fields, ignoreold=0)         
    696701            else :     
  • pykota/trunk/pykota/version.py

    r1095 r1099  
    2121# 
    2222 
    23 __version__ = "1.14alpha8_unofficial" 
     23__version__ = "1.14alpha9_unofficial" 
    2424 
    2525__doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""