@@ -38,7 +38,7 @@ class UserController extends AppController
38
38
'Setting ' ,
39
39
);
40
40
public $ _daos = array ('User ' , 'Folder ' , 'Folderpolicygroup ' , 'Folderpolicyuser ' , 'Group ' );
41
- public $ _components = array ('Breadcrumb ' , 'Date ' , 'Filter ' , 'Sortdao ' );
41
+ public $ _components = array ('Breadcrumb ' , 'Date ' , 'Filter ' , 'Random ' , ' Sortdao ' );
42
42
public $ _forms = array ('User ' );
43
43
44
44
/** Init Controller */
@@ -110,7 +110,7 @@ public function recoverpasswordAction()
110
110
}
111
111
}
112
112
113
- $ pass = UtilityComponent:: generateRandomString ( 10 );
113
+ $ pass = $ this -> Component -> Random -> generateString ( 32 );
114
114
$ this ->User ->changePassword ($ user , $ pass );
115
115
116
116
$ url = $ this ->getServerURL ().$ this ->view ->webroot ;
@@ -206,7 +206,7 @@ public function ajaxregisterAction()
206
206
$ nopass = (bool ) $ this ->getParam ('nopassword ' );
207
207
if ($ adminCreate && $ nopass ) {
208
208
$ form ->populate ($ this ->getRequest ()->getPost ());
209
- $ passwd = UtilityComponent:: generateRandomString (32 );
209
+ $ passwd = $ this -> Component -> Random -> generateString (32 );
210
210
$ form ->getElement ('password1 ' )->setValue ($ passwd );
211
211
$ form ->getElement ('password2 ' )->setValue ($ passwd );
212
212
@@ -891,7 +891,7 @@ public function settingsAction()
891
891
return ;
892
892
}
893
893
894
- $ tmpPath = $ this ->getDataDirectory ('thumbnail ' ).'/ ' .mt_rand ( 1 , 1000 );
894
+ $ tmpPath = $ this ->getDataDirectory ('thumbnail ' ).'/ ' .$ this -> Component -> Random -> generateInt ( );
895
895
if (!file_exists ($ this ->getDataDirectory ('thumbnail ' ))) {
896
896
throw new Zend_Exception (
897
897
"Thumbnail path does not exist: " .$ this ->getDataDirectory ('thumbnail ' )
@@ -900,15 +900,15 @@ public function settingsAction()
900
900
if (!file_exists ($ tmpPath )) {
901
901
mkdir ($ tmpPath );
902
902
}
903
- $ tmpPath .= '/ ' .mt_rand ( 1 , 1000 );
903
+ $ tmpPath .= '/ ' .$ this -> Component -> Random -> generateInt ( );
904
904
if (!file_exists ($ tmpPath )) {
905
905
mkdir ($ tmpPath );
906
906
}
907
- $ destionation = $ tmpPath ."/ " .mt_rand ( 1 , 1000 ).'.jpeg ' ;
908
- while (file_exists ($ destionation )) {
909
- $ destionation = $ tmpPath ."/ " .mt_rand ( 1 , 1000 ).'.jpeg ' ;
907
+ $ destination = $ tmpPath ."/ " .$ this -> Component -> Random -> generateInt ( ).'.jpg ' ;
908
+ while (file_exists ($ destination )) {
909
+ $ destination = $ tmpPath ."/ " .$ this -> Component -> Random -> generateInt ( ).'.jpg ' ;
910
910
}
911
- $ pathThumbnail = $ destionation ;
911
+ $ pathThumbnail = $ destination ;
912
912
913
913
list ($ x , $ y ) = getimagesize ($ path ); //--- get size of img ---
914
914
$ thumb = 32 ; //--- max. size of thumb ---
0 commit comments