Changeset 3171
- Timestamp:
- 06/12/12 19:14:16 (11 months ago)
- Location:
- alternc/trunk
- Files:
-
- 5 edited
-
bureau/admin/quotas_users.php (modified) (1 diff)
-
bureau/class/m_quota.php (modified) (1 diff)
-
install/mysql.sql (modified) (1 diff)
-
src/quota_init (modified) (1 diff)
-
src/spoolsize.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
alternc/trunk/bureau/admin/quotas_users.php
r3135 r3171 281 281 list($ws)=@mysql_fetch_array(mysql_query("SELECT size FROM size_web WHERE uid='".$c["uid"]."';")); 282 282 283 if ( $totalweb)283 if (isset($totalweb) && $totalweb){ 284 284 $pc=intval(100*$ws/$totalweb); 285 else 285 } 286 else{ 286 287 $pc=0; 288 } 287 289 288 290 if ($mode==0) { -
alternc/trunk/bureau/class/m_quota.php
r3150 r3171 182 182 // It's a disk resource, update it with shell command 183 183 exec("/usr/lib/alternc/quota_edit $cuid $size"); 184 echo "quota set :::::ciud: $cuid :::: size: $size :::: \n ";185 184 // Now we check that the value has been written properly : 186 exec("/usr/lib/alternc/quota_get ".$cuid,$a); 187 print_r($a); 185 exec("usr/lib/alternc/quota_get $cuid",$a); 188 186 if ($size!=$a[1]) { 189 187 $err->raise("quota",1); -
alternc/trunk/install/mysql.sql
r3144 r3171 328 328 329 329 INSERT IGNORE INTO defquotas (quota,value) VALUES ('dom',1); 330 INSERT IGNORE INTO defquotas (quota,value) VALUES ('web',51200); 330 331 INSERT IGNORE INTO defquotas (quota,value) VALUES ('mail',10); 331 332 INSERT IGNORE INTO defquotas (quota,value) VALUES ('ftp',2); -
alternc/trunk/src/quota_init
r2477 r3171 53 53 while ($c=mysql_fetch_array($r)) { 54 54 $s=mysql_query("SELECT name FROM quotas WHERE uid='$c[uid]' AND name='$name';"); 55 if ( !mysql_num_rows($s)) {56 mysql_query("INSERT INTO quotas (uid,name,total) VALUES ('$c[uid]','$name','$quota') ;");55 if (mysql_num_rows($s)) { 56 mysql_query("INSERT INTO quotas (uid,name,total) VALUES ('$c[uid]','$name','$quota') on DUPLICATE KEY UPDATE total=$quota;"); 57 57 } 58 58 } -
alternc/trunk/src/spoolsize.php
r2729 r3171 7 7 8 8 echo "---------------------------\n Generating size-cache for mail accounts\n\n"; 9 $r=mysql_query("SELECT * FROM mail_users WHERE alias NOT LIKE '%@%' AND alias LIKE '%\_%';");9 $r=mysql_query("SELECT * FROM dovecot_view ;"); 10 10 while ($c=mysql_fetch_array($r)) { 11 echo $c[" alias"]; flush();12 $size=exec("/usr/lib/alternc/du.pl ".$c[" path"]);13 mysql_query("REPLACE INTO size_mail SET alias='".addslashes($c[" alias"])."',size='$size';");11 echo $c["user"]; flush(); 12 $size=exec("/usr/lib/alternc/du.pl ".$c["userdb_home"]); 13 mysql_query("REPLACE INTO size_mail SET alias='".addslashes($c["user"])."',size='$size';"); 14 14 echo " done ($size KB)\n"; flush(); 15 15 }
Note: See TracChangeset
for help on using the changeset viewer.
