diff --git a/webgui/include/ajax/functions/AdminUserLogs.php b/webgui/include/ajax/functions/AdminUserLogs.php index 16b2f0fc285080e8066109d92b70a3d7ef5ecdb4..54ef3febdaf12403ce1e0721861349f7c8e98564 100644 --- a/webgui/include/ajax/functions/AdminUserLogs.php +++ b/webgui/include/ajax/functions/AdminUserLogs.php @@ -92,7 +92,7 @@ function getAdminUserLogsSummary($params) { topups WHERE topups.UserID = ? - AND topups.ValidFrom = ? + AND topups.ValidFrom <= ? AND topups.ValidTo >= ? AND topups.Depleted = 0 ORDER BY diff --git a/webgui/include/ajax/functions/WiSPUserLogs.php b/webgui/include/ajax/functions/WiSPUserLogs.php index 1e21b91cda72b905c91208da9094e1e706d81334..d9822eee3184a391768e6ca17f8dee7edf979841 100644 --- a/webgui/include/ajax/functions/WiSPUserLogs.php +++ b/webgui/include/ajax/functions/WiSPUserLogs.php @@ -92,7 +92,7 @@ function getWiSPUserLogsSummary($params) { topups WHERE topups.UserID = ? - AND topups.ValidFrom = ? + AND topups.ValidFrom <= ? AND topups.ValidTo >= ? AND topups.Depleted = 0 ORDER BY diff --git a/webgui/include/ajax/functions/WiSPUsers.php b/webgui/include/ajax/functions/WiSPUsers.php index 07372733d3fcd0f7610db1b4d8069ef2c2ab7b27..cac8ea8a206521e9e52f43bf8ccd7a6ab0239a30 100644 --- a/webgui/include/ajax/functions/WiSPUsers.php +++ b/webgui/include/ajax/functions/WiSPUsers.php @@ -373,22 +373,31 @@ function createWiSPUser($params) { switch ($attr['Modifier']) { case "Seconds": $attrValue = $attr['Value'] / 60; + break; case "Minutes": $attrValue = $attr['Value']; + break; case "Hours": $attrValue = $attr['Value'] * 60; + break; case "Days": $attrValue = $attr['Value'] * 1440; + break; case "Weeks": $attrValue = $attr['Value'] * 10080; + break; case "Months": $attrValue = $attr['Value'] * 44640; + break; case "MBytes": $attrValue = $attr['Value']; + break; case "GBytes": $attrValue = $attr['Value'] * 1000; + break; case "TBytes": $attrValue = $attr['Value'] * 1000000; + break; } } } @@ -499,22 +508,31 @@ function createWiSPUser($params) { switch ($attr['Modifier']) { case "Seconds": $attrValue = $attr['Value'] / 60; + break; case "Minutes": $attrValue = $attr['Value']; + break; case "Hours": $attrValue = $attr['Value'] * 60; + break; case "Days": $attrValue = $attr['Value'] * 1440; + break; case "Weeks": $attrValue = $attr['Value'] * 10080; + break; case "Months": $attrValue = $attr['Value'] * 44640; + break; case "MBytes": $attrValue = $attr['Value']; + break; case "GBytes": $attrValue = $attr['Value'] * 1000; + break; case "TBytes": $attrValue = $attr['Value'] * 1000000; + break; } } } @@ -699,22 +717,31 @@ function updateWiSPUser($params) { switch ($attr['Modifier']) { case "Seconds": $attrValue = $attr['Value'] / 60; + break; case "Minutes": $attrValue = $attr['Value']; + break; case "Hours": $attrValue = $attr['Value'] * 60; + break; case "Days": $attrValue = $attr['Value'] * 1440; + break; case "Weeks": $attrValue = $attr['Value'] * 10080; + break; case "Months": $attrValue = $attr['Value'] * 44640; + break; case "MBytes": $attrValue = $attr['Value']; + break; case "GBytes": $attrValue = $attr['Value'] * 1000; + break; case "TBytes": $attrValue = $attr['Value'] * 1000000; + break; } } }