| | 173 | |
| | 174 | {{{ |
| | 175 | if(dynamic_cast<CDBMySQL*>(appDB)) { |
| | 176 | string reportsPath = APP_DATA_DIR; |
| | 177 | reportsPath += "reports"; |
| | 178 | DEBUG_MSG("Check for report dir [%s]\n", reportsPath.c_str()); |
| | 179 | if(stat(reportsPath.c_str(), &st) == 0) { |
| | 180 | DEBUG_MSG("Reports dir [%s] found \n", reportsPath.c_str()); |
| | 181 | // There is a reports directory. Check for symbolic link such as: |
| | 182 | // /usr/share/apache2/default-site/htdocs/reports/custom/soXXXXX |
| | 183 | // If link is not there create the link to the reports directory. |
| | 184 | // When reports.php runs it will check for these files to add links to the reports |
| | 185 | if(stat(REPORTS_SYMLINK, &st) != 0) { |
| | 186 | DEBUG_MSG("Symlink [%s] not found - creating it\n", REPORTS_SYMLINK); |
| | 187 | char cmd[400]; |
| | 188 | sprintf_s(cmd, "ln -s %s %s", reportsPath.c_str(), REPORTS_SYMLINK); |
| | 189 | DEBUG_MSG("cmd [%s]\n", cmd); |
| | 190 | if(system(cmd) != 0) { |
| | 191 | DEBUG_MSG("Error create symlink\n"); |
| | 192 | } |
| | 193 | } |
| | 194 | } |
| | 195 | } |
| | 196 | }}} |
| | 197 | |
| | 198 | |