Sunday 15 April 2012

php - how can limit the number of users in sugar crm CE -


I want to limit the number of users to the Chinese CRM so that the administrator can only make a fixed number for the user such as 20 -25 And if he tries to make more than that, then it will show a message that "you have exceeded the user limit".

I tried to do it with putting a selected user query with CRM DB and if it exceeds the limit, it will not show the rest of the edit, but unfortunately it is not working anymore, some time Works but sometimes it fails.

The normal php syntax, detailviewdefs.php and other files in those editviewdefs.php

Here is the syntax:

   

I know that the above method I am using is structured and not suitable because it can be sorted with some Chinese CRM code.

In such a systematic and structured way, I can create a certain function that shows a new message when I click on creating a new user and disable or hide the user creation panel.

thanks

with my exception to the error for mysqli error

  & lt; Php $ con = mysqli_connect ("localhost", "dbname", "dbuser", "dbpass"); // Check connection if (mysqli_connect_errno ()) {echo "failed to connect to MySQL:". Mysqli_connect_error (); } And {$ sql = "select * from users"; $ Result = mysqli_query ($ thief, $ sql); $ Rowcount = mysqli_num_rows ($ result); $ Rowcount per line; If ($ line coins & lt; = 25) {& lt; & Lt; Rest edited view code eg $ Viewdefs ['User'] ....... etc & gt; & Gt; } And {& lt; & Lt; A message & gt; & Gt; }} Mysqli_free_result ($ result); Mysqli_close ($ thief); }? & Gt;  

No comments:

Post a Comment