Changeset 2317

Show
Ignore:
Timestamp:
06/15/05 22:46:47 (19 years ago)
Author:
jerome
Message:

Big database changes.
Severity : From now on, existing datas have to be migrated
using the appropriate script if needed. LDAP users will need
to use the new schema. Beginning tomorrow, the code will be in
experimental quality instead of stable quality.

Location:
pykota/trunk
Files:
1 added
5 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/initscripts/ldap/pykota.schema

    r2146 r2317  
    226226        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) 
    227227         
     228# pykotaPrecomputedJobSize 
     229attributetype ( 1.3.6.1.4.1.16868.1.1.33 NAME 'pykotaPrecomputedJobSize' 
     230        DESC 'Precomputed job size in number of pages in the history' 
     231        EQUALITY integerMatch 
     232        SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) 
     233 
     234# pykotaPrecomputedJobPrice 
     235attributetype ( 1.3.6.1.4.1.16868.1.1.34 NAME 'pykotaPrecomputedJobPrice' 
     236        DESC 'Precomputed Price of a particular job in the history, float' 
     237        EQUALITY caseIgnoreIA5Match 
     238        SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) 
     239         
     240# pykotaMaxJobSize 
     241attributetype ( 1.3.6.1.4.1.16868.1.1.35 NAME 'pykotaMaxJobSize' 
     242        DESC 'Maximum size allowed for a job' 
     243        EQUALITY integerMatch 
     244        SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) 
     245 
     246# pykotaTemporaryDenied 
     247attributetype ( 1.3.6.1.4.1.16868.1.1.36 NAME 'pykotaTemporaryDenied' 
     248        DESC 'Indicates if the user is temporarily denied to print' 
     249        SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE ) 
     250 
     251# pykotaPassThrough 
     252attributetype ( 1.3.6.1.4.1.16868.1.1.37 NAME 'pykotaPassThrough' 
     253        DESC 'Indicates if the printer is in pass through mode' 
     254        SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE ) 
    228255 
    229256#         
     
    235262        DESC 'PyKota Auxiliary User Account' 
    236263        MUST ( uid ) 
    237         MAY  ( pykotaUserName $ pykotaLimitBy $ mail ) ) 
     264        MAY  ( pykotaUserName $ pykotaLimitBy $ mail $ description ) ) 
    238265         
    239266# pykotaGroup         
     
    241268        DESC 'PyKota Auxiliary Group' 
    242269        MUST ( cn ) 
    243         MAY  ( pykotaGroupName $ pykotaLimitBy $ memberUid $ uniqueMember $ member ) ) 
     270        MAY  ( pykotaGroupName $ pykotaLimitBy $ memberUid $ uniqueMember $ member $ description ) ) 
    244271         
    245272# pykotaPrinter         
     
    247274        DESC 'PyKota Printer' 
    248275        MUST ( cn ) 
    249         MAY  ( description $ pykotaPrinterName $ pykotaPricePerPage $ pykotaPricePerJob $ pykotaPrinterCoefficient $ uniqueMember ) ) 
     276        MAY  ( pykotaMaxJobSize $ pykotaPassThrough $ description $ pykotaPrinterName $ pykotaPricePerPage $ pykotaPricePerJob $ pykotaPrinterCoefficient $ uniqueMember ) ) 
    250277         
    251278# pykotaUserPQuota         
     
    253280        DESC 'PyKota User Quota on a Printer' 
    254281        MUST ( cn $ pykotaUserName $ pykotaPrinterName ) 
    255         MAY  ( pykotaPageCounter $ pykotaLifePageCounter $ pykotaSoftLimit $ pykotaHardLimit $ pykotaDateLimit $ pykotaWarnCount ) ) 
     282        MAY  ( pykotaMaxJobSize $ pykotaTemporaryDenied $ pykotaPageCounter $ pykotaLifePageCounter $ pykotaSoftLimit $ pykotaHardLimit $ pykotaDateLimit $ pykotaWarnCount ) ) 
    256283         
    257284# pykotaGroupPQuota         
     
    259286        DESC 'PyKota Group Quota on a Printer' 
    260287        MUST ( cn $ pykotaGroupName $ pykotaPrinterName ) 
    261         MAY  ( pykotaSoftLimit $ pykotaHardLimit $ pykotaDateLimit ) ) 
     288        MAY  ( pykotaMaxJobSize $ pykotaSoftLimit $ pykotaHardLimit $ pykotaDateLimit ) ) 
    262289         
    263290# pykotaJob         
     
    265292        DESC 'An entry in the job history for a printer' 
    266293        MUST ( cn $ pykotaUserName $ pykotaPrinterName $ pykotaJobId ) 
    267         MAY  ( pykotaBillingCode $ pykotaPrinterPageCounter $ pykotaJobSize $ pykotaAction $ pykotaJobPrice $ pykotaFileName $ pykotaTitle $ pykotaCopies $ pykotaOptions $ pykotaHostName $ pykotaJobSizeBytes $ pykotaMD5Sum $ pykotaPages ) ) 
     294        MAY  ( pykotaPrecomputedJobPrice $ pykotaPrecomputedJobSize $ pykotaBillingCode $ pykotaPrinterPageCounter $ pykotaJobSize $ pykotaAction $ pykotaJobPrice $ pykotaFileName $ pykotaTitle $ pykotaCopies $ pykotaOptions $ pykotaHostName $ pykotaJobSizeBytes $ pykotaMD5Sum $ pykotaPages ) ) 
    268295         
    269296# pykotaAccountBalance 
     
    278305        MAY ( pykotaPrinterName ) )  
    279306         
     307# pykotaBilling 
     308objectclass ( 1.3.6.1.4.1.16868.1.2.10 NAME 'pykotaBilling' SUP top AUXILIARY 
     309        DESC 'Allowed billing codes' 
     310        MUST ( cn $ pykotaBillingCode ) 
     311        MAY ( pykotaPageCounter $ pykotaBalance ) ) 
     312         
    280313# pykotaObject - Use it if you have to  
    281314objectclass ( 1.3.6.1.4.1.16868.1.2.9 NAME 'pykotaObject' SUP top STRUCTURAL 
  • pykota/trunk/initscripts/postgresql/pykota-postgresql.sql

    r2303 r2317  
    5353                   lifetimepaid FLOAT DEFAULT 0.0, 
    5454                   limitby TEXT DEFAULT 'quota', 
     55                   description TEXT, 
    5556                   overcharge FLOAT NOT NULL DEFAULT 1.0); 
    5657                    
     
    6061CREATE TABLE groups(id SERIAL PRIMARY KEY NOT NULL, 
    6162                    groupname TEXT UNIQUE NOT NULL, 
     63                    description TEXT, 
    6264                    limitby TEXT DEFAULT 'quota'); 
    6365                     
     
    6971                      description TEXT, 
    7072                      priceperpage FLOAT DEFAULT 0.0, 
    71                       priceperjob FLOAT DEFAULT 0.0); 
     73                      priceperjob FLOAT DEFAULT 0.0, 
     74                      passthrough BOOLEAN DEFAULT 'f', 
     75                      maxjobsize INT4); 
    7276                     
    7377-- 
     
    8286                        hardlimit INT4, 
    8387                        datelimit TIMESTAMP, 
     88                        maxjobsize INT4, 
     89                        temporarydenied BOOLEAN DEFAULT 'f', 
    8490                        warncount INT4 DEFAULT 0);  
    8591CREATE INDEX userpquota_u_id_ix ON userpquota (userid); 
     
    107113                        pages TEXT, 
    108114                        billingcode TEXT, 
     115                        precomputedjobsize INT4, 
     116                        precomputedjobprice FLOAT, 
    109117                        jobdate TIMESTAMP DEFAULT now(), 
    110118                        CONSTRAINT checkUserPQuota FOREIGN KEY (userid, printerid) REFERENCES userpquota(userid, printerid)); 
     
    122130                         softlimit INT4, 
    123131                         hardlimit INT4, 
     132                         maxjobsize INT4, 
    124133                         datelimit TIMESTAMP); 
    125134CREATE INDEX grouppquota_g_id_ix ON grouppquota (groupid); 
     
    158167                           CONSTRAINT coeffconstraint UNIQUE (printerid, label)); 
    159168 
     169--  
     170-- Create the table for the billing codes 
     171-- 
     172CREATE TABLE billingcodes (id SERIAL PRIMARY KEY NOT NULL, 
     173                           label TEXT UNIQUE NOT NULL, 
     174                           balance FLOAT DEFAULT 0.0, 
     175                           pagecounter INT4 DEFAULT 0); 
     176 
    160177--                         
    161178-- Set some ACLs                         
    162179-- 
    163 REVOKE ALL ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments, coefficients FROM public;                         
    164 REVOKE ALL ON users_id_seq, groups_id_seq, printers_id_seq, userpquota_id_seq, grouppquota_id_seq, jobhistory_id_seq, payments_id_seq, coefficients_id_seq FROM public; 
     180REVOKE ALL ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments, coefficients, billingcodes FROM public; 
     181REVOKE ALL ON users_id_seq, groups_id_seq, printers_id_seq, userpquota_id_seq, grouppquota_id_seq, jobhistory_id_seq, payments_id_seq, coefficients_id_seq, billingcodes_id_seq FROM public; 
    165182 
    166 GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments, coefficients TO pykotaadmin; 
    167 GRANT SELECT, UPDATE ON users_id_seq, groups_id_seq, printers_id_seq, userpquota_id_seq, grouppquota_id_seq, jobhistory_id_seq, payments_id_seq, coefficients_id_seq TO pykotaadmin; 
    168 GRANT SELECT ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments, coefficients TO pykotauser; 
     183GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments, coefficients, billingcodes TO pykotaadmin; 
     184GRANT SELECT, UPDATE ON users_id_seq, groups_id_seq, printers_id_seq, userpquota_id_seq, grouppquota_id_seq, jobhistory_id_seq, payments_id_seq, coefficients_id_seq, billingcodes_id_seq TO pykotaadmin; 
     185GRANT SELECT ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments, coefficients, billingcodes TO pykotauser; 
    169186 
  • pykota/trunk/NEWS

    r2316 r2317  
    2222PyKota NEWS : 
    2323        
     24    - 1.23alpha12 : 
     25     
     26        - Big database changes, use the migration scripts ! 
     27         
    2428    - 1.23alpha11 : 
    2529     
  • pykota/trunk/pykota/version.py

    r2316 r2317  
    2222# 
    2323 
    24 __version__ = "1.23alpha11_unofficial" 
     24__version__ = "1.23alpha12_unofficial" 
    2525 
    2626__doc__ = "PyKota : a complete Printing Quota Solution for CUPS and LPRng." 
  • pykota/trunk/TODO

    r2315 r2317  
    4848                these values, and PyKota processes the job as usual. 
    4949           
    50         - Add a table listing all the allowed billing codes. Unknown 
    51           billing codes should produce an action which is configurable 
    52           (reject the job being the default). The billing codes table 
    53           will contains total pages and cost, and life time pages 
    54           and cost => speedup for LDAP, and allows people to cleanup 
    55           the printing history in any case. A tool to manage the 
    56           table of billing codes must be written, but this will 
    57           be easy. 
    58            
    59         - Pass-through mode for printers : history correctly filled (including 
    60           job size) but no impact on user's page counter or account 
    61           balance : this is meant to be a temporary situation for 
    62           a printer to be in pass-through mode, for example during 
    63           an exam where the faculty pays for the printouts and we 
    64           don't want our users to complain about their credits being 
    65           "eaten" for mandatory printouts. 
    66            
    6750        - Allow several levels of administrative priviledges by allowing 
    6851          files like ~pykota/pykotadmin.someusername.conf (readonly by 
     
    7154          in PyKota's database ! 
    7255         
    73         - Add a "printing denied" indicator on user print quota entries,   
    74           to temporarily forbid an user to print on a particular printer. 
    75            
    76         - Maybe per user "denyduplicates" : my 5 years old daughter  
    77           just prints again when the printer is off... 
    78           Maybe not needed anymore since denyduplicates now allows 
    79           an external command to decide if the job should be allowed 
    80           or denied. 
    81            
    82         - Now that the job size is ALWAYS precomputed, add a  
    83           MaxJobSize attribute to users and groups (printers as 
    84           well, maybe ?) to limit each job's size if needed. 
    85            
    86         - Add precomputed job size (and price) to the history for 
    87           controlling purpose. 
    88            
    8956        - Try to talk to education based distribution coordinators 
    9057          (SambaEdu, SkoleLinux, K12LTSP, ...) to see how to 
     
    10067         
    10168        - Price and statistics per page format. 
    102          
    103         - Add a description field to users/groups. 
    10469         
    10570        - Allow the admin to choose an action to take when the database