Get IP of the frontend user in TYPO3 10 - typo3

I need the IP of the frontend user in a validator for tx_form. In older TYPO3 version I used GeneralUtility::getIndpEnv() for this. How can I achieve this in TYPO3 10?

you can achieve this with GeneralUtility::getIndpEnv('REMOTE_ADDR'); just as you did before.

Related

Cannot log in to backend of a copied TYPO3 site

A copy of a TYPO3 4.4 site has been installed on a Windows 10 system. PHP and Apache versions are approximately equal. The site itself is functional and appears complete. I can log in to the backend of the live site. I cannot log in to the backend of the copied site.
Trials:
Change database character set from latin1 to utf8
Change my credentials to database credentials (username, md5('password')) used in localconf.php
Comment out modified $TYPO3_CONF_VARS['BE']['installToolPassword'] in localconf.php
./typoconf/temp_* deleted
Edit #1:
If localconf.php is modified to point to the live database I am able to log in. This suggests that the issue may be a difference in server versions.
Edit #2:
Installing MySQL server version 5.5.54 (live site has 5.5.53) makes no difference.
Have you tried to set
from:
'loginSecurityLevel' => 'rsa',
to:
'loginSecurityLevel' => 'normal',
in your localconfig.php file?
I had the same problem. The reason was that someone copied the system via phpmyadmin.
I copied the typo3 mysql-DB via
mysqldump ... > ...sql
and
mysql ... < ...sql
and now it works
Maybe you should look at your cookie domain in localconf.php
It took a look a ancient history to see that one source of the error was the MySQL strict mode. The clue that told me I was logged in was a record in the sys_log table with a current timestamp & my userid. An old bug report included a comment on strict mode. By changing MySQL 5.7 my.ini from sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" to sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" I gained access to my sandbox. Hooray for wayback machines everywhere.

Mounting TYPO3 FAL storage with another domain

Using TYPO3 6.1.9 (will be updated soon to latest 6.2).
Is it currently possible to use a FAL storage with another domain? The webspace looks like this:
path-to-web-directories/
- maindomain.com/
- - fileadmin/
- - typo3/
- sub.domain.com/
- - files.txt
In the TYPO3 backend I created a file storage for the directories path-to-web-directories/maindomain.com/fileadmin/ and one for path-to-web-directories/sub.domain.com/. This is really great and work so far. I can manage the files in both storages.
But now if I set a link to a file located in sub.domain.com, the URL looks like this:
http://www.maindomain.com/sub.domain.com/files.txt
instead of
http://sub.domain.com/files.txt
Ist this issue a part of TYPO3 or can I configure this with realUrl (which I'm using)? And how can I do this?
I resolved the problem:
The URL is generated in the class TYPO3\CMS\Core\Resource\Driver\LocalDriver->getPublicUrl
In this case an own extension with a new resource driver is needed.

ElasticSearch with Play 2 configuration

I am trying to use the ElasticSearch module (https://github.com/cleverage/play2-elasticsearch) with my Play 2 application. In the readme, it says I should add the following to my application.conf:
## define local mode or not
elasticsearch.local=false
## list clients
elasticsearch.client="192.168.0.46:9300"
# ex : elasticsearch.client="192.168.0.46:9300,192.168.0.47:9300"
What is local mode? What is my client URL supposed to be? I can not find any information on what these options should be. With my current options, I get a NoNodeAvailableException.
Some people suggest:
elasticsearch.local=false elasticsearch.client=mynode1:9200,mynode2:9200
But what is mynode1 and mynode2? It doesn't work with my application. Can anyone help? Thanks
What is local mode?
If elaticsearch.local=true, a elasticsearch node is started in your application ( embedded )
What is my client URL supposed to be?
It's your host:port, but the port is the tcp transport define on your elasticsearch node.
By default, the port start on 9300 ( http://www.elasticsearch.org/guide/reference/modules/transport.html )
I can not find any information on what these options should be. With my current options, I get a NoNodeAvailableException.
I think you have a problem on port number.
mynode1 and mynode2 are elasticsearch nodes.
Do you have any Elasticsearch node running?
On which IP address?
Can you try to connect on these nodes using curl, for example:
curl localhost:9200
Or
curl YOURIPADDRESS:9200
If one of this is successful, then configure your play app using YOURIPADDRESS:9300 as Nicolas Boire wrote before.
If no one is successful, check that you have installed Elasticsearch and launched it before.
HTH
I've just had the same problem, be sure that you respect the version requirements written in the table : https://github.com/cleverage/play2-elasticsearch
At the beginning, I set up the latest version of the plugin 0.8.1 but my ElasticSearch version was 1.0.2.
By starting ES with version 0.9.13, it worked.

create a symfony2 service

I am new to Symfony2 and am trying to setup my first service. This is a curl service.
I have followed the directions on the documentation, but haven't been able to get anything to load. I am using version 2.0.1
In my app/config/config.yml I have added:
parameters:
curl_service.class: FTW\GuildBundle\Services\Curl
services:
curl_service:
class: %curl_service.class%
The class file is located in src\FTW\GuildBundle\Services\Curl.php and
it's namespace is namespace FTW\GuildBundle\Services;
The class name is Curl
When I try to load my service with $curl_service = $this->get('curl_service'); the error is get is
You have requested a non-existent service "curl_service".
I think I am missing something very simple... any help would be appreciated!
Make sure you clear your cache at /app/cache/ even in development mode.
It works well on my fresh Symfony 2.0.4 install. Looks like your config is not taken into account. Are you working in dev environment?

Problem with Joomla auto logoff feature

I am using joomla 1.5.14(Stable),PHP Version: 5.2.6,Web Server: Apache/2.2.3 (CentOS), CBSub: 1.2.1.
My login is with cbsub, I have added an IP check for user in login function in comprofiler.php. As I added my code for check, auto log off feature of Joomla is not working properly. Can anyone suggest how can I enable auto log off feature without deleting my IP check.
Thanks in advance!!
Gurpreet Kaur
Just change the session time in Global Configuration.