diff --git a/doc/html/classRedmatrix_1_1Import_1_1Import-members.html b/doc/classRedmatrix_1_1Import_1_1Import-members.html similarity index 99% rename from doc/html/classRedmatrix_1_1Import_1_1Import-members.html rename to doc/classRedmatrix_1_1Import_1_1Import-members.html index 2be66a2ea..736a303d8 100644 --- a/doc/html/classRedmatrix_1_1Import_1_1Import-members.html +++ b/doc/classRedmatrix_1_1Import_1_1Import-members.html @@ -128,5 +128,4 @@ $(document).ready(function(){initNavTree('classRedMatrix_1_1Import_1_1Import.htm run()RedMatrix\Import\Import store($item, $update=false)RedMatrix\Import\Import - - + \ No newline at end of file diff --git a/doc/html/classRedMatrix_1_1Import_1_1Import.html b/doc/classRedmatrix_1_1Import_1_1Import.html similarity index 99% rename from doc/html/classRedMatrix_1_1Import_1_1Import.html rename to doc/classRedmatrix_1_1Import_1_1Import.html index 2119780c3..0ee9373f2 100644 --- a/doc/html/classRedMatrix_1_1Import_1_1Import.html +++ b/doc/classRedmatrix_1_1Import_1_1Import.html @@ -443,5 +443,4 @@ Private Attributes
  • include/Import/Importer.php
  • - - + \ No newline at end of file diff --git a/doc/html/classRedMatrix_1_1Import_1_1Import-members.html b/doc/html/classRedMatrix_1_1Import_1_1Import-members.html index 2be66a2ea..736a303d8 100644 --- a/doc/html/classRedMatrix_1_1Import_1_1Import-members.html +++ b/doc/html/classRedMatrix_1_1Import_1_1Import-members.html @@ -128,5 +128,4 @@ $(document).ready(function(){initNavTree('classRedMatrix_1_1Import_1_1Import.htm run()RedMatrix\Import\Import store($item, $update=false)RedMatrix\Import\Import - - + \ No newline at end of file diff --git a/doc/html/classRedMatrix_1_1Import_1_1Import.js b/doc/html/classRedMatrix_1_1Import_1_1Import.js deleted file mode 100644 index 03e429289..000000000 --- a/doc/html/classRedMatrix_1_1Import_1_1Import.js +++ /dev/null @@ -1,18 +0,0 @@ -var classRedMatrix_1_1Import_1_1Import = -[ - [ "convert_child", "classRedMatrix_1_1Import_1_1Import.html#a5434325afb2c633c52540127d717800a", null ], - [ "convert_item", "classRedMatrix_1_1Import_1_1Import.html#a107703a43a1b0ceb2af7ae470cb3f218", null ], - [ "convert_taxonomy", "classRedMatrix_1_1Import_1_1Import.html#addf6e53dacd971eaab49be4b17a767d6", null ], - [ "get_children", "classRedMatrix_1_1Import_1_1Import.html#a57561904b0f127e0d9a3e2c33688daf8", null ], - [ "get_credentials", "classRedMatrix_1_1Import_1_1Import.html#a24134929d9a8a682da2036a0bf326367", null ], - [ "get_item", "classRedMatrix_1_1Import_1_1Import.html#a27987a41cb703a796f1821baeb4774a2", null ], - [ "get_item_ident", "classRedMatrix_1_1Import_1_1Import.html#a772c28edf36aaf8e66007a95004c4059", null ], - [ "get_itemlist", "classRedMatrix_1_1Import_1_1Import.html#a855cd5a79b95d269ae8737fae774e3bc", null ], - [ "get_taxonomy", "classRedMatrix_1_1Import_1_1Import.html#ae3c6472bea1a44025bc2e152604eb20c", null ], - [ "run", "classRedMatrix_1_1Import_1_1Import.html#a8d138a9a7d4f79b81d3446ca216a602c", null ], - [ "store", "classRedMatrix_1_1Import_1_1Import.html#a33ed595de044c0ec1cd84cca719e31dc", null ], - [ "$credentials", "classRedMatrix_1_1Import_1_1Import.html#a864aac9fadb4846f5d9f840e8e0f440f", null ], - [ "$itemlist", "classRedMatrix_1_1Import_1_1Import.html#ad0d2bdc3b388220479063915b4f5c2fc", null ], - [ "$items", "classRedMatrix_1_1Import_1_1Import.html#a0a05dac405ccc5b617b7b7b3c8ed783c", null ], - [ "$src_items", "classRedMatrix_1_1Import_1_1Import.html#a88c2eeba8d0cba3e7c12a2c45ba0fbc6", null ] -]; \ No newline at end of file diff --git a/doc/html/classRedmatrix_1_1Import_1_1Import.html b/doc/html/classRedmatrix_1_1Import_1_1Import.html index 2119780c3..3920dd3d9 100644 --- a/doc/html/classRedmatrix_1_1Import_1_1Import.html +++ b/doc/html/classRedmatrix_1_1Import_1_1Import.html @@ -444,4 +444,3 @@ Private Attributes - diff --git a/doc/html/classRedmatrix_1_1Import_1_1Import.js b/doc/html/classRedmatrix_1_1Import_1_1Import.js index 03e429289..6d01249e1 100644 --- a/doc/html/classRedmatrix_1_1Import_1_1Import.js +++ b/doc/html/classRedmatrix_1_1Import_1_1Import.js @@ -15,4 +15,4 @@ var classRedMatrix_1_1Import_1_1Import = [ "$itemlist", "classRedMatrix_1_1Import_1_1Import.html#ad0d2bdc3b388220479063915b4f5c2fc", null ], [ "$items", "classRedMatrix_1_1Import_1_1Import.html#a0a05dac405ccc5b617b7b7b3c8ed783c", null ], [ "$src_items", "classRedMatrix_1_1Import_1_1Import.html#a88c2eeba8d0cba3e7c12a2c45ba0fbc6", null ] -]; \ No newline at end of file +]; diff --git a/doc/html/namespaceRedMatrix_1_1Import.html b/doc/html/namespaceRedMatrix_1_1Import.html deleted file mode 100644 index a0ab85227..000000000 --- a/doc/html/namespaceRedMatrix_1_1Import.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - -The Red Matrix: RedMatrix\Import Namespace Reference - - - - - - - - - - - - - -
    -
    - - - - - - - -
    -
    The Red Matrix -
    -
    -
    - - - - - -
    -
    - -
    -
    -
    - -
    - -
    - All Classes Namespaces Files Functions Variables Pages
    - - -
    - -
    - -
    - -
    -
    RedMatrix\Import Namespace Reference
    -
    -
    - - - - -

    -Classes

    class  Import
     
    -
    -
    - diff --git a/doc/html/namespaceRedMatrix_1_1Import.js b/doc/html/namespaceRedMatrix_1_1Import.js deleted file mode 100644 index c26a05140..000000000 --- a/doc/html/namespaceRedMatrix_1_1Import.js +++ /dev/null @@ -1,4 +0,0 @@ -var namespaceRedMatrix_1_1Import = -[ - [ "Import", "classRedMatrix_1_1Import_1_1Import.html", "classRedMatrix_1_1Import_1_1Import" ] -]; \ No newline at end of file diff --git a/include/account.php b/include/account.php index 8df44acba..88036e2ef 100644 --- a/include/account.php +++ b/include/account.php @@ -590,6 +590,32 @@ function service_class_allows($uid,$property,$usage = false) { } } +// like service_class_allows but queries by account rather than channel +function account_service_class_allows($aid,$property,$usage = false) { + $a = get_app(); + $r = q("select account_service_class as service_class from account where account_id = %d limit 1", + intval($aid) + ); + if($r !== false and count($r)) { + $service_class = $r[0]['service_class']; + } + + if(! x($service_class)) + return true; // everything is allowed + + $arr = get_config('service_class',$service_class); + if(! is_array($arr) || (! count($arr))) + return true; + + if($usage === false) + return ((x($arr[$property])) ? (bool) $arr[$property] : true); + else { + if(! array_key_exists($property,$arr)) + return true; + return (((intval($usage)) < intval($arr[$property])) ? true : false); + } +} + function service_class_fetch($uid,$property) { $a = get_app(); diff --git a/include/identity.php b/include/identity.php index 17238ea99..2f400520f 100644 --- a/include/identity.php +++ b/include/identity.php @@ -34,7 +34,7 @@ function identity_check_service_class($account_id) { $ret['total_identities'] = intval($r[0]['total']); - if(! service_class_allows($account_id,'total_identities',$r[0]['total'])) { + if(! account_service_class_allows($account_id,'total_identities',$r[0]['total'])) { $result['message'] .= upgrade_message(); return $result; } diff --git a/mod/manage.php b/mod/manage.php index b0de945bf..b6e10bf46 100644 --- a/mod/manage.php +++ b/mod/manage.php @@ -133,7 +133,7 @@ function manage_content(&$a) { intval(get_account_id()), intval(PAGE_REMOVED) ); - $limit = service_class_fetch(local_user(),'total_identities'); + $limit = account_service_class_fetch(get_account_id(),'total_identities'); if($limit !== false) { $channel_usage_message = sprintf( t("You have created %1$.0f of %2$.0f allowed channels."), $r[0]['total'], $limit); }