Need a support from an expert ..
Below is a part from "facebook_login" osclass plugin and it will get the FB photo to osclass profile.
if ($ ext == '') {
$ update = array (
'user_id' => $ user_id,
'pic_ext' => '.jpg'
);
// clear old image if exists
if ($ img && @ $ img ['user_id']> 0) {
unlink (osc_plugins_path (). 'profile_picture / images / profile'. $ img ['user_id']. $ img ['pic_ext']);
$ this-> dao-> delete ($ this-> getTable_profile_picture (), array ('pk_i_id' => $ img ['id']));
}
$ fb_img = file_get_contents ('https: //'. $ img_url);
$ file = osc_plugins_path (). 'profile_picture / images / profile'. $ user_id. '.jpg';
file_put_contents ($ file, $ fb_img);
return $ this-> dao-> insert ($ this-> getTable_profile_picture (), $ update);
}
Problem is: This doesn't work until enable "allow_url_fopen". But I have seen many places as "allow_url_fopen" enabling is risky.
So need an expert help to overcome this (above code get in to functional) without enabling "allow_url_fopen".
Thanks in advance ..
Below is a part from "facebook_login" osclass plugin and it will get the FB photo to osclass profile.
if ($ ext == '') {
$ update = array (
'user_id' => $ user_id,
'pic_ext' => '.jpg'
);
// clear old image if exists
if ($ img && @ $ img ['user_id']> 0) {
unlink (osc_plugins_path (). 'profile_picture / images / profile'. $ img ['user_id']. $ img ['pic_ext']);
$ this-> dao-> delete ($ this-> getTable_profile_picture (), array ('pk_i_id' => $ img ['id']));
}
$ fb_img = file_get_contents ('https: //'. $ img_url);
$ file = osc_plugins_path (). 'profile_picture / images / profile'. $ user_id. '.jpg';
file_put_contents ($ file, $ fb_img);
return $ this-> dao-> insert ($ this-> getTable_profile_picture (), $ update);
}
Problem is: This doesn't work until enable "allow_url_fopen". But I have seen many places as "allow_url_fopen" enabling is risky.
So need an expert help to overcome this (above code get in to functional) without enabling "allow_url_fopen".
Thanks in advance ..
Последнее редактирование: