We present a self-interaction-free density-functional theory (DFT) for the treatment of both the static properties of the ground states and the photoionization processes of many-electron systems. The method is based on the Krieger-Li-Iafrate (KLI) treatment of the optimized effective potential (OEP) theory and the incorporation of an explicit self-interaction correction (SIC) term. Such an extended OEP--KLI-SIC method uses only orbital-independent single-particle local potentials and is thus computationally more efficient and yet maintains good accuracy. The usefulness of the procedure is examined by the studies of the static properties of the ground states of atoms (Z\ensuremath{\leqslant}18) and the dynamical photoionization processes involving autoionizing resonances. Both the energy functionals of the local spin-density approximation (LSDA) and Becke's exchange energy functional and the correlation energy functional of Lee-Yang-Parr (BLYP) are used as the input to the KLI-SIC calculations. It is found that the implementation of the KLI-SIC procedure gives rise to optimized effective potentials that possess the correct behavior in both short-range and long-range regimes. As a consequence, the LSDA and BLYP ionization potentials are significantly improved. For higher-Z atoms, the improvement of the LSDA total energies and the ionization potentials are particularly remarkable, approaching the experimental or exact values. As another test of the KLI-SIC method, we have performed the calculation of the photoionization cross sections of the Ne atom using both the time-independent and time-dependent LSDA (TDLSDA) methods. We found that the TDLSDA results agree closely with the experimental data in the broad peak region, followed by a series of sharp resonances due to the 2s\ensuremath{\rightarrow}np resonant transitions. The calculated linewidths and resonance line profile parameters are in reasonable agreement with both the experimental and the configuration-interaction (R-matrix) results, demonstrating the usefulness of the KLI-SIC procedure for achieving accurate DFT calculations in both static properties and dynamical processes.