DMXzone Security Provider PHP Support Product Page

Solved

Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes

Reported 30 May 2014 13:07:21
5
have this problem
30 May 2014 13:07:21 Randy Riesterer posted:
I created a database-connected Security Provider Builder for my website. I've added a custom logon form for single sign-on using Security Provider Executer with 'Admin' and 'Member' levels. I've added 'Member' security to all Member pages on my site that are to be protected. The same for our site 'Admin' pages. With all this setup, when I use the logon form to access a protected Member or Admin page, I get this error: "Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes)".

Any idea what's causing this?

Replies

Replied 30 May 2014 13:09:45
30 May 2014 13:09:45 Randy Riesterer replied:
An additional followup question... How do I create a "Log Out" button so a user can logout without having to leave the site?
Replied 30 May 2014 13:24:30
30 May 2014 13:24:30 Teodor Kuduschiev replied:
Hello Randy,
Can you please send me a screenshot of the security provider configuration:
As for the logout -
1 . Go to Site > DMXzone Security Provider > Manage Page Security Provider Executor -> Click OK
2. Click your button, go to behaviors > Add New > DMXzone > Control DMXzone Security Provider > Log Out
3. Go to Site > DMXzone Security Provider > Manage Page Security Provider Executor -> Click Behaviors > When the user logout > Go To Url...
Replied 23 Jun 2014 09:23:57
23 Jun 2014 09:23:57 包 四維 replied:
I have the really same problem as same as Randy
all detail "screenshot" right here...



Replied 27 Jun 2014 17:28:59
27 Jun 2014 17:28:59 DuFour DuFour replied:
I noticed for me, this issue seemed to be caused when I I had the Site Security Provider set to "Database". When I changed it to "single user", it seemed to work fine.
Replied 28 Jun 2014 03:30:14
28 Jun 2014 03:30:14 包 四維 replied:
hi all
just like the "DuFour Advertising" said
"single user" and "Users List" is no problem,but if choose "Database" will really cause this issue,trust DuFour and me,we tried many times

this is really a big issue
why this issue will remain 4 months passed ?
Replied 30 Jun 2014 09:08:31
30 Jun 2014 09:08:31 Teodor Kuduschiev replied:
Hello,
The problem is not caused by the fact you are using Database Users. There is something wrongly configured in the database user setup - please send screenshot of the database users configuration so i can check what is wrong -
Replied 30 Jun 2014 13:54:10
30 Jun 2014 13:54:10 包 四維 replied:
hi Teodor,here is my screenshot
is that you want it ?
www.littlebau.com/res001.gif
www.littlebau.com/res002.gif
Replied 09 Jul 2014 04:07:23
09 Jul 2014 04:07:23 包 四維 replied:
hi Teodor
2 weeks passed...
well...
is there any feedback about this issue ? (last time I already give you my screen shot)
Replied 09 Jul 2014 09:43:19
09 Jul 2014 09:43:19 Teodor Kuduschiev replied:
Hello,
Indeed there is some kind of memory leak, that produces this error. Our developers are currently working on this, as this happens on certain systems and is not that easy to be isolated. I will keep you informed about the progress on this.
Replied 09 Jul 2014 10:19:15
09 Jul 2014 10:19:15 包 四維 replied:
hi Teodor
thanks for your reply...
I found some solution to solve the problem
I tried,but not work for me...
maybe can let the developers tried it too...

add some code in the php file
<?php
ini_set("memory_limit", "256M";
?>
or
fix the php.ini
memory_limit = 256M
Replied 09 Jul 2014 10:21:56
09 Jul 2014 10:21:56 Teodor Kuduschiev replied:
No, actually this is not a solution.The script should not be using even half of this. You will be notified as soon as we fix this.
Replied 09 Jul 2014 10:22:58
09 Jul 2014 10:22:58 包 四維 replied:
OK
that's all
thanks again~
Replied 11 Jul 2014 12:57:56
11 Jul 2014 12:57:56 Teodor Kuduschiev replied:
Hi all,
There was a minor problem in the code.. causing so much problems.
Please open the following file: ScriptLibrary\dmxDatabaseConnector\sqlBuilder.php
Go to line: 339 and change:
 'operator' => (is_null($value) ? '' : $operator),

to
  'operator' => (is_null($value) ? '=' : $operator),

This will fix all of the issue causing the Allowed memory size ... errors. We will include this fix in the upcoming update.
Replied 11 Jul 2014 13:35:53
11 Jul 2014 13:35:53 包 四維 replied:
hi Teodor
if you have not login,the memory size error message will appear
and...
use your way can really solve the problem
but...
after login success,the same page appear another wrong message
"Forbidden"
that's all
Replied 11 Jul 2014 14:45:09
11 Jul 2014 14:45:09 Teodor Kuduschiev replied:
There is another change that needs to be made in the following file:
ScriptLibrary\dmxSecurityProviderdmxSecurityProvider.php
Find and replace:
line 133-143:
public function restrict($opts = array()) {
		if (is_string($opts) && $opts[0] == '{') {
			$opts = json_decode($opts);
		} else {
			$opts = (object)array('permissions' => $opts);
		}
		$opts->permissions = is_array($opts->permissions) ? $opts->permissions : array($opts->permissions);
		if (!$this->identity) $this->login(_request('username'), _request('password'));
		if (!$this->identity) $this->unauthorized($opts->loginUrl);
		if (!$this->provider->permissions($this->identity, $opts->permissions)) $this->forbidden($opts->forbiddenUrl);
	}

with
public function restrict($opts = array()) {
		if (is_string($opts) && $opts[0] == '{') {
			$opts = json_decode($opts);
		} else {
			$opts = (object)array('permissions' => $opts);
		}
		if (!$this->identity) $this->login(_request('username'), _request('password'));
		if (!$this->identity) $this->unauthorized($opts->loginUrl);
		if ($opts->permissions) {
			$opts->permissions = is_array($opts->permissions) ? $opts->permissions : array($opts->permissions);
			if (!$this->provider->permissions($this->identity, $opts->permissions)) $this->forbidden($opts->forbiddenUrl);
		}
	}

Replied 11 Jul 2014 15:26:26
11 Jul 2014 15:26:26 包 四維 replied:
I tried...
finally solve the problem
thanks Teodor
hope the "upcoming update" as soon as possible
Replied 11 Jul 2014 15:36:29
11 Jul 2014 15:36:29 Teodor Kuduschiev replied:
The update is going to be available in about two weeks.

Reply to this topic