13
13
}
14
14
15
15
if ($ nv_Request ->isset_request ('module ' , 'post ' )) {
16
- $ module_name = $ nv_Request ->get_title ('module ' , 'post ' );
16
+ $ modname = $ nv_Request ->get_title ('module ' , 'post ' );
17
17
$ is_setup = $ nv_Request ->get_int ('setup ' , 'post ' , 0 );
18
18
19
19
$ contents = array (
20
20
'status ' => 'error ' ,
21
- 'module ' => $ module_name ,
22
- 'message ' => array ( 0 => 'Module not exists ' ),
21
+ 'module ' => $ modname ,
22
+ 'message ' => array (
23
+ 0 => 'Module not exists '
24
+ ),
25
+ 'checkss ' => md5 (NV_CHECK_SESSION . '_ ' . $ module_name . '_setup_mod_ ' . $ modname ),
23
26
'code ' => 0
24
27
);
25
28
26
- if (! empty ($ module_name ) and preg_match ($ global_config ['check_module ' ], $ module_name )) {
29
+ if (! empty ($ modname ) and preg_match ($ global_config ['check_module ' ], $ modname )) {
27
30
$ sth = $ db ->prepare ('SELECT module_file FROM ' . $ db_config ['prefix ' ] . '_ ' . NV_LANG_DATA . '_modules WHERE title= :title ' );
28
- $ sth ->bindParam (':title ' , $ module_name , PDO ::PARAM_STR );
31
+ $ sth ->bindParam (':title ' , $ modname , PDO ::PARAM_STR );
29
32
$ sth ->execute ();
30
- list ($ module_file ) = $ sth ->fetch (3 );
33
+ list ($ modfile ) = $ sth ->fetch (3 );
31
34
32
- if (empty ($ module_file )) {
35
+ if (empty ($ modfile )) {
33
36
$ sth = $ db ->prepare ('SELECT basename FROM ' . $ db_config ['prefix ' ] . '_setup_extensions WHERE title=:title AND type= \'module \'' );
34
- $ sth ->bindParam (':title ' , $ module_name , PDO ::PARAM_STR );
37
+ $ sth ->bindParam (':title ' , $ modname , PDO ::PARAM_STR );
35
38
$ sth ->execute ();
36
- list ($ module_file ) = $ sth ->fetch (3 );
39
+ list ($ modfile ) = $ sth ->fetch (3 );
37
40
38
- if (empty ($ module_file ) and file_exists (NV_ROOTDIR . '/modules/ ' . $ module_name . '/version.php ' )) {
39
- $ module_file = $ module_name ;
41
+ if (empty ($ modfile ) and file_exists (NV_ROOTDIR . '/modules/ ' . $ modname . '/version.php ' )) {
42
+ $ modfile = $ modname ;
40
43
}
41
44
}
42
45
43
- if (! empty ($ module_file )) {
46
+ if (! empty ($ modfile )) {
44
47
$ contents ['status ' ] = 'success ' ;
45
48
$ contents ['message ' ][0 ] = $ lang_module ['reinstall_note1 ' ];
46
49
47
50
// Check sample data file
48
- if (file_exists (NV_ROOTDIR . '/modules/ ' . $ module_file . '/language/data_ ' . NV_LANG_DATA . '.php ' )) {
51
+ if (file_exists (NV_ROOTDIR . '/modules/ ' . $ modfile . '/language/data_ ' . NV_LANG_DATA . '.php ' )) {
49
52
$ contents ['message ' ][1 ] = $ lang_module ['reinstall_note2 ' ];
50
53
$ contents ['message ' ][2 ] = $ lang_module ['reinstall_note3 ' ];
51
54
$ contents ['code ' ] = 1 ;
52
- } elseif (file_exists (NV_ROOTDIR . '/modules/ ' . $ module_file . '/language/data_en.php ' )) {
55
+ } elseif (file_exists (NV_ROOTDIR . '/modules/ ' . $ modfile . '/language/data_en.php ' )) {
53
56
$ contents ['message ' ][1 ] = $ lang_module ['reinstall_note2 ' ];
54
57
$ contents ['message ' ][2 ] = $ lang_module ['reinstall_note4 ' ];
55
58
$ contents ['code ' ] = 1 ;
60
63
nv_jsonOutput ($ contents );
61
64
}
62
65
63
- nv_redirect_location (NV_BASE_ADMINURL . 'index.php? ' . NV_LANG_VARIABLE . '= ' . NV_LANG_DATA . '& ' . NV_NAME_VARIABLE . '= ' . $ module_name );
66
+ nv_redirect_location (NV_BASE_ADMINURL . 'index.php? ' . NV_LANG_VARIABLE . '= ' . NV_LANG_DATA . '& ' . NV_NAME_VARIABLE . '= ' . $ modname );
0 commit comments