938 Posts in 271 Topics by 291 members
Forum Module
SilverStripe Forums » Forum Module » Problem with GeoIP
Discuss the Forum Module.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 2689 Views |
-
Problem with GeoIP

7 September 2009 at 4:11am
i cand edit admin profile in admin section and also edit profile in forum section
In admin errori is
ERROR [Warning]: exec() has been disabled for security reasons
IN GET /admin/security/EditForm/field/Members/item/1/edit?ajax=1
Line 285 in /var/www/virtual/leeviland.org/htdocs/sapphire/integration/Geoip.phpSource
======
276: *
277: * @param string $address The IP address to get the country of
278: * @param boolean $codeOnly Returns just the country code
279: */
280: static function ip2country($address, $codeOnly = false) {
281: // Return if in CLI, or you'll get this error: "sh: geoiplookup: command not found"
282: if(Director::is_cli()) return false;
283:
284: $cmd = 'geoiplookup ' . escapeshellarg($address);
* 285: exec($cmd, $result, $code);
286:
287: // Note: At time of writing, $result is always zero for this program
288:
289: if($code == 127) return false;
290: if($result == false) return false;
291:<ul>exec(geoiplookup '88.196.203.66',,)
line 285 of Geoip.phpGeoip::ip2country(88.196.203.66,1)
line 324 of Geoip.phpGeoip::visitor_country()
line 13 of CountryDropdownField.phpCountryDropdownField->__construct(Country,Country)
line 204 of ForumRole.phpForumRole->updateCMSFields(FieldSet,,,,,,)
line 777 of Object.phpObject->extend(updateCMSFields,FieldSet)
line 1727 of DataObject.phpDataObject->getCMSFields()
line 833 of Member.phpMember->getCMSFields()
line 474 of ComplexTableField.phpComplexTableField->getCustomFieldsFor(Member)
line 514 of ComplexTableField.phpComplexTableField->getFieldsFor(Member)
line 769 of ComplexTableField.phpComplexTableField_ItemRequest->DetailForm()
call_user_func_array(Array,Array)
line 408 of ViewableData.phpViewableData->XML_val(DetailForm,,1)
line 20 of .cache.var.www.virtual.leeviland.org.htdocs.sapphire.templates.ComplexTableField_popup.ssinclude(/var/www/virtual/leeviland.org/htdocs/silverstripe-cache/.cache.var.www.virtual.leeviland.org.htdocs.sapphire.templates.ComplexTableField_popup.ss)
line 354 of SSViewer.phpSSViewer->process(MemberTableField_ItemRequest)
line 773 of ViewableData.phpViewableData->renderWith(ComplexTableField_popup)
line 730 of ComplexTableField.phpComplexTableField_ItemRequest->edit(HTTPRequest)
line 129 of RequestHandler.phpRequestHandler->handleRequest(HTTPRequest)
line 143 of RequestHandler.phpRequestHandler->handleRequest(HTTPRequest)
line 143 of RequestHandler.phpRequestHandler->handleRequest(HTTPRequest)
line 143 of RequestHandler.phpRequestHandler->handleRequest(HTTPRequest)
line 122 of Controller.phpController->handleRequest(HTTPRequest)
line 277 of Director.phpDirector::handleRequest(HTTPRequest,Session)
line 121 of Director.phpDirector::direct(/admin/security/EditForm/field/Members/item/1/edit)
line 118 of main.php</ul>
In http://www.leeviland.org/ForumMemberProfile/edit error is:
[Warning] exec() has been disabled for security reasons
GET /ForumMemberProfile/edit
Line 285 in /var/www/virtual/leeviland.org/htdocs/sapphire/integration/Geoip.phpSource
276 *
277 * @param string $address The IP address to get the country of
278 * @param boolean $codeOnly Returns just the country code
279 */
280 static function ip2country($address, $codeOnly = false) {
281 // Return if in CLI, or you'll get this error: "sh: geoiplookup: command not found"
282 if(Director::is_cli()) return false;
283
284 $cmd = 'geoiplookup ' . escapeshellarg($address);
285 exec($cmd, $result, $code);
286
287 // Note: At time of writing, $result is always zero for this program
288
289 if($code == 127) return false;
290 if($result == false) return false;
291
Trace
•exec(geoiplookup '88.196.203.66',,)
Line 285 of Geoip.php
•Geoip::ip2country(88.196.203.66,1)
Line 324 of Geoip.php
•Geoip::visitor_country()
Line 13 of CountryDropdownField.php
•CountryDropdownField->__construct(Country,Riik)
Line 168 of ForumRole.php
•ForumRole->getForumFields()•call_user_func_array(Array,Array)
Line 525 of Object.php
•Object->__call(getForumFields,Array)•Member->getForumFields()
Line 471 of ForumMemberProfile.php
•ForumMemberProfile->EditProfileForm()
Line 449 of ForumMemberProfile.php
•ForumMemberProfile->edit(HTTPRequest)
Line 162 of Controller.php
•Controller->handleAction(HTTPRequest)
Line 129 of RequestHandler.php
•RequestHandler->handleRequest(HTTPRequest)
Line 122 of Controller.php
•Controller->handleRequest(HTTPRequest)
Line 277 of Director.php
•Director::handleRequest(HTTPRequest,Session)
Line 121 of Director.php
•Director::direct(/ForumMemberProfile/edit)
Line 118 of main.phphow to fix it
-
Re: Problem with GeoIP

7 September 2009 at 11:41am
See if this helps - open up that file (sapphire/integration/Geoip.php). Go down to line 285 and change it to
$code = "";
$result = false;
@exec($cmd, $result, $code);Otherwise you can get round it by just putting a return false; at the top of that function though a nicer fallback that we can get into core like above would be good
-
Re: Problem with GeoIP

17 February 2013 at 4:01pm Last edited: 17 February 2013 4:02pm
good answer
__________
tutalib
| 2689 Views | ||
|
Page:
1
|
Go to Top |



